You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+17-14Lines changed: 17 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -51,19 +51,20 @@ npm run build
51
51
```
52
52
53
53
54
-
## Custom Config Files
54
+
## Custom Configuration
55
55
56
-
In many cases, the defaults which Ionic provides covers most of the scenarios required by developers. However, Ionic App Scripts does provide multiple ways to configure and override the defaults for each of the various tasks. Note that Ionic will always apply its defaults for any property that was not provided by custom configurations.
56
+
In many cases, the defaults which Ionic provides covers most of the scenarios required by developers. However, Ionic App Scripts does provide multiple ways to configure and override the defaults for each of the various tasks. Note that Ionic will always apply its defaults for any property that was not provided by custom configuration.
Within the `package.json` file, there's also a handy [config](https://docs.npmjs.com/misc/config#per-package-config-settings) property which can be used. Below is an example of setting a custom config file using the `config` property in a project's `package.json`.
62
+
Ionic projects use the `package.json` file for configuration. There's a handy [config](https://docs.npmjs.com/misc/config#per-package-config-settings) property which can be used. Below is an example of setting a custom config file using the `config` property in a project's `package.json`.
63
63
64
64
```
65
65
"config": {
66
-
"ionic_rollup": "./config/rollup.config.js",
66
+
"ionic_bundler": "rollup",
67
+
"ionic_source_map": "source-map",
67
68
"ionic_cleancss": "./config/cleancss.config.js"
68
69
},
69
70
```
@@ -103,14 +104,15 @@ npm run build --rollup ./config/rollup.config.js
| bundler |`ionic_bundler`|`--bundler`|`webpack`| Chooses which bundler to use: `webpack` or `rollup`|
110
+
| source map type |`ionic_source_map`|`--sourceMap`|`eval`| Chooses the webpack `devtool` option. We recommend `eval` or `source-map`|
111
+
| root directory |`ionic_root_dir`|`--rootDir`|`process.cwd()`| The directory path of the Ionic app |
112
+
| tmp directory |`ionic_tmp_dir`|`--tmpDir`|`.tmp`| A temporary directory for codegen'd files using the Angular `ngc` AoT compiler |
113
+
| src directory |`ionic_src_dir`|`--srcDir`|`src`| The directory holding the Ionic src code |
114
+
| www directory |`ionic_www_dir`|`--wwwDir`|`www`| The deployable directory containing everything needed to run the app |
115
+
| build directory |`ionic_build_dir`|`--buildDir`|`build`| The build process uses this directory to store generated files, etc |
114
116
115
117
116
118
### Ionic Environment Variables
@@ -126,6 +128,7 @@ These environment variables are automatically set to [Node's `process.env`](http
126
128
|`IONIC_WWW_DIR`| The absolute path to the app's public distribution directory. |
127
129
|`IONIC_BUILD_DIR`| The absolute path to the app's bundled js and css files. |
128
130
|`IONIC_APP_SCRIPTS_DIR`| The absolute path to the `@ionic/app-scripts` node_module directory. |
131
+
|`IONIC_SOURCE_MAP`| The Webpack `devtool` setting. We recommend `eval` or `source-map`. |
129
132
130
133
The `process.env.IONIC_ENV` environment variable can be used to test whether it is a `prod` or `dev` build, which automatically gets set by any command. By default the `build` task is `prod`, and the `watch` and `serve` tasks are `dev`. Additionally, using the `--dev` command line flag will force the build to use `dev`.
0 commit comments