@@ -53,50 +53,51 @@ module.exports = async (api, options, rootOptions) => {
5353 nativescript : {
5454 id : 'org.nativescript.application' ,
5555 'tns-ios' : {
56- version : '5.2.0 '
56+ version : '5.2.1 '
5757 } ,
5858 'tns-android' : {
59- version : '5.2.0 '
59+ version : '5.2.1 '
6060 }
6161 } ,
6262 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' ,
6865 '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' ,
7168 // 'inspect:android': 'npm run setup-webpack-config && vue inspect -- --env.android > out-android.js',
7269 // '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'
7978 } ,
8079 dependencies : {
8180 'nativescript-vue' : '^2.0.2' ,
8281 'tns-core-modules' : '^5.2.1'
8382 } ,
8483 devDependencies : {
85- 'cross-env' : '^5.2.0' ,
8684 'nativescript-dev-webpack' : '^0.17.0' ,
8785 'nativescript-vue-template-compiler' : '^2.0.2' ,
8886 'nativescript-worker-loader' : '~0.9.1' ,
8987 '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'
9192 }
9293 } ) ;
9394
9495 // add scripts when we are also developing for the web
9596 if ( ! options . isNativeOnly ) {
9697 api . extendPackage ( {
9798 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'
100101 //'inspect:web': 'npm run setup-webpack-config && vue inspect -- --env.web > out-web.js'
101102 }
102103 } ) ;
@@ -252,6 +253,13 @@ module.exports = async (api, options, rootOptions) => {
252253 nativeOnlyRenameFiles ( genConfig . dirPathPrefix + genConfig . nativeAppPathModifier . slice ( 0 , - 1 ) ) ;
253254 }
254255
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+
255263 if ( api . hasPlugin ( 'typescript' ) ) {
256264 if ( fs . existsSync ( api . resolve ( 'tslint.json' ) ) ) {
257265 require ( '../lib/tslint' ) ( { } , api , true ) ;
0 commit comments