Skip to content

Commit 5002763

Browse files
Dev to Master (#13)
* Fixed Import Issues Added --env recognition Added scss imports to templates Fixed fork-ts-checker-webpack-plugin not found Fixed typescript not found * Updated README for: env info npm inspect:platform info * Add changes from rejected PR12 from mylmz10 * Fixed DefinePlugin over writing CLI 3 options
1 parent 47c0a56 commit 5002763

38 files changed

+1745
-1661
lines changed

Diff for: .prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"semicolons": true,
77
"bracketSpacing": true,
88
"arrowParens": "always",
9-
"useTabs": true
9+
"useTabs": false
1010
}

Diff for: README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,24 @@ You will have several options in serving and building the project:
5555

5656
The basic `serve` and `build` options should be similar to what is in a CLI 3 project except the added options to dictate which kind of environment you are using: `web`, `android` or `ios`. Please note that when building web projects, they will output to `dist` and when building native projects, they will output to `platforms\android` or `platforms\ios` depending on which you are building at the time.
5757

58+
#### --env command line recognition
59+
Basic support for passing the `env` command line option is in place, but has a slightly different syntax since we're working with the CLI 3 webpack infrastructure. To inject items into `env` at run-time, you will need to add `-- --env.option` Where option is one of the recognized options that Nativescript-Vue and this project supports.
60+
An example of this would be something like this: `npm run serve:android -- --env.production`. This would allow you to serve up a Production build of your Android app versus just running `npm run serve:android` which would serve a Development version of the same.
61+
5862
#### Webpack related information
5963
The options passed in at `npm run` will dictate what webpack config is provided. The first choice webpack will make is if this is a `web` or `native` environment. Then, if it's a `native` environment, it will determine choices to be made between `ios` and `android`.
6064

6165
Each time the project is built or served, the plugin will copy the latest webpack config from the cli to the root of your project. When you build a project, it will clean-up this file at the end, but just serving the project will not. This is an issue with [nativescript-dev-webpack](https://github.com/NativeScript/nativescript-dev-webpack) and cannot be overcome at this time.
6266

6367
#### Inspecting the Webpack config
64-
If you'd like to see what the webpack config is doing then you can run the following:
65-
`vue inspect --mode development.web > output.js` and the `output.js` file in root will show you what's going on. Subtitute `development.android` or `production.ios`, etc to see the different configs based on the environmental variables.
68+
If you'd like to see what the webpack config is doing then you can run one of the following:
69+
1. `npm run inspect:android`
70+
2. `npm run inspect:ios`
71+
3. `npm run inspect:web`
72+
73+
These will default to showing you the Development version of the webpack config. You can pass in the `-- --env.production` option to see the Production version of the config.
74+
75+
If you'd like to control this on your own and not use the provided `npm scripts` then you can do something like: `vue inspect --mode development.web > output.js` and the `output.js` file in root will show you what's going on. Subtitute `development.android` or `production.ios`, etc to see the different configs based on the environmental variables.
6676

6777
#### Aliases
6878
Prebuilt in the webpack config are several aliases that you can use. Here is a table listing out the various alias and the folder they use based on the environment chosen:

0 commit comments

Comments
 (0)