Skip to content

Commit 74f9d20

Browse files
committed
In order to add conditionals here, it's better not extends+replace and create the whole main.native.js file here.
1 parent 99065eb commit 74f9d20

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed
Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
---
2-
extend: '@vue/cli-service/generator/template/src/main.js'
3-
replace:
4-
- !!js/regexp /import Vue from 'vue'/
5-
- !!js/regexp /import App from './App.vue'/
6-
- !!js/regexp /Vue.config.productionTip = false/
7-
- !!js/regexp /h => h\(App\),/
8-
- !!js/regexp /}\)\.\$mount\('#app'\)/
9-
---
10-
11-
<%# REPLACE %>
121
import Vue from 'nativescript-vue';
13-
<%# END_REPLACE %>
14-
15-
<%# REPLACE %>
2+
<%_ if (rootOptions.router) { _%>
163
import Navigator from 'nativescript-vue-navigator'
4+
<%_ } _%>
175

186
import App from './App.vue';
7+
<%_ if (rootOptions.router) { _%>
198
import { options } from './router';
209

2110
// adapt vue-router routes to nativescript-vue-navigator
@@ -27,20 +16,14 @@ const routes = options.routes.reduce((data, route) => {
2716
}, {});
2817

2918
Vue.use(Navigator, { routes });
30-
<%# END_REPLACE %>
19+
<%_ } _%>
3120

32-
<%# REPLACE %>
3321
// Set the following to `true` to hide the logs created by nativescript-vue
3422
Vue.config.silent = false;
3523
// Set the following to `false` to not colorize the logs created by nativescript-vue
3624
// disabled in template due to typing issue for Typescript projects....NEEDS TO BE FIXED
3725
// Vue.config.debug = true;
38-
<%# END_REPLACE %>
39-
40-
<%# REPLACE %>
41-
h => h('frame', [h(App)]),
42-
<%# END_REPLACE %>
4326

44-
<%# REPLACE %>
27+
new Vue({
28+
render: h => h('frame', [h(App)]),
4529
}).$start();
46-
<%# END_REPLACE %>

0 commit comments

Comments
 (0)