@@ -53,50 +53,51 @@ module.exports = async (api, options, rootOptions) => {
53
53
nativescript : {
54
54
id : 'org.nativescript.application' ,
55
55
'tns-ios' : {
56
- version : '5.2.0 '
56
+ version : '5.2.1 '
57
57
} ,
58
58
'tns-android' : {
59
- version : '5.2.0 '
59
+ version : '5.2.1 '
60
60
}
61
61
} ,
62
62
scripts : {
63
- 'build:android' :
64
- // eslint-disable-next-line max-len
65
- 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=production.android tns build android --bundle --env.production && npm run remove-webpack-config' ,
66
- 'build:ios' :
67
- 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=production.ios tns build ios --bundle --env.production && npm run remove-webpack-config' ,
63
+ 'build:android' : 'npm run setup-webpack-config && tns build android --bundle --env.production && npm run remove-webpack-config' ,
64
+ 'build:ios' : 'npm run setup-webpack-config && tns build ios --bundle --env.production && npm run remove-webpack-config' ,
68
65
'remove-webpack-config' : 'node ./node_modules/vue-cli-plugin-nativescript-vue/lib/scripts/webpack-maintenance post' ,
69
- 'serve:android' : 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=development.android tns run android --bundle --env.development' ,
70
- 'serve:ios' : 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=development.ios tns run ios --bundle --env.development' ,
66
+ 'serve:android' : 'npm run setup-webpack-config && tns run android --bundle --env.development' ,
67
+ 'serve:ios' : 'npm run setup-webpack-config && tns run ios --bundle --env.development' ,
71
68
// 'inspect:android': 'npm run setup-webpack-config && vue inspect -- --env.android > out-android.js',
72
69
// 'inspect:ios': 'npm run setup-webpack-config && vue inspect -- --env.ios > out-ios.js',
73
- 'debug:android' : 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=development.android tns debug android --bundle --env.development' ,
74
- 'debug:ios' : 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=development.ios tns debug ios --bundle --env.development' ,
75
- 'preview:android' :
76
- 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=development.android tns preview --bundle --env.development --env.android' ,
77
- 'preview:ios' : 'npm run setup-webpack-config && cross-env-shell VUE_CLI_MODE=development.android tns preview --bundle --env.development --env.ios' ,
78
- 'setup-webpack-config' : 'node ./node_modules/vue-cli-plugin-nativescript-vue/lib/scripts/webpack-maintenance pre'
70
+ 'debug:android' : 'npm run setup-webpack-config && tns debug android --bundle --env.development' ,
71
+ 'debug:ios' : 'npm run setup-webpack-config && tns debug ios --bundle --env.development' ,
72
+ 'preview:android' : 'npm run setup-webpack-config && tns preview --bundle --env.development --env.android' ,
73
+ 'preview:ios' : 'npm run setup-webpack-config && tns preview --bundle --env.development --env.ios' ,
74
+ 'setup-webpack-config' : 'node ./node_modules/vue-cli-plugin-nativescript-vue/lib/scripts/webpack-maintenance pre' ,
75
+ 'clean:platforms' : 'rimraf platforms' ,
76
+ 'clean:android' : 'rimraf platforms/android' ,
77
+ 'clean:ios' : 'rimraf platforms/ios'
79
78
} ,
80
79
dependencies : {
81
80
'nativescript-vue' : '^2.0.2' ,
82
81
'tns-core-modules' : '^5.2.1'
83
82
} ,
84
83
devDependencies : {
85
- 'cross-env' : '^5.2.0' ,
86
84
'nativescript-dev-webpack' : '^0.17.0' ,
87
85
'nativescript-vue-template-compiler' : '^2.0.2' ,
88
86
'nativescript-worker-loader' : '~0.9.1' ,
89
87
'node-sass' : '^4.11.0' ,
90
- 'string-replace-loader' : '^2.1.1'
88
+ 'string-replace-loader' : '^2.1.1' ,
89
+ rimraf : '^2.6.3' ,
90
+ webpack : '^4.29.6' ,
91
+ 'webpack-cli' : '^3.2.3'
91
92
}
92
93
} ) ;
93
94
94
95
// add scripts when we are also developing for the web
95
96
if ( ! options . isNativeOnly ) {
96
97
api . extendPackage ( {
97
98
scripts : {
98
- 'serve:web' : 'vue-cli-service serve --mode development.web --env.development --env.web ' ,
99
- 'build:web' : 'vue-cli-service build --mode production.web --env.production --env.web '
99
+ 'serve:web' : 'vue-cli-service serve --mode development.web' ,
100
+ 'build:web' : 'vue-cli-service build --mode production.web'
100
101
//'inspect:web': 'npm run setup-webpack-config && vue inspect -- --env.web > out-web.js'
101
102
}
102
103
} ) ;
@@ -252,6 +253,13 @@ module.exports = async (api, options, rootOptions) => {
252
253
nativeOnlyRenameFiles ( genConfig . dirPathPrefix + genConfig . nativeAppPathModifier . slice ( 0 , - 1 ) ) ;
253
254
}
254
255
256
+ // remove router config for projects that don't use vue-router
257
+ if ( ! rootOptions . router ) {
258
+ fs . remove ( genConfig . dirPathPrefix + genConfig . nativeAppPathModifier + 'router' + genConfig . jsOrTs , ( err ) => {
259
+ if ( err ) throw err ;
260
+ } ) ;
261
+ }
262
+
255
263
if ( api . hasPlugin ( 'typescript' ) ) {
256
264
if ( fs . existsSync ( api . resolve ( 'tslint.json' ) ) ) {
257
265
require ( '../lib/tslint' ) ( { } , api , true ) ;
0 commit comments