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.
| ionic-angular entry point |`ionic_angular_entry_point`|`--ionicAngularEntryPoint`|`index.js`| entry point file for ionic-angular |
115
120
| bundler |`ionic_bundler`|`--bundler`|`webpack`| Chooses which bundler to use: `webpack` or `rollup`|
116
121
| source map type |`ionic_source_map_type`|`--sourceMapType`|`source-map`| Chooses the webpack `devtool` option. `eval` and `source-map` are supported |
117
122
| generate source map |`ionic_generate_source_map`|`--generateSourceMap`|`true`| Determines whether to generate a source map or not |
@@ -125,6 +130,17 @@ npm run build --rollup ./config/rollup.config.js
125
130
| output css file |`ionic_output_css_file_name`|`--outputCssFileName`|`main.css`| name of css file generated in `buildDir`|
126
131
| output css map file |`ionic_output_css_map_file_name`|`--outputCssMapFileName`|`main.css.map`| name of css source map file generated in `buildDir`|
127
132
| bail on lint error |`ionic_bail_on_lint_error`|`--bailOnLintError`|`null`| Set to `true` to make stand-alone lint commands fail with non-zero status code |
133
+
| write AoT files to disk |`ionic_aot_write_to_disk`|`--aotWriteToDisk`|`null`| Set to `true` to write files to disk for debugging |
134
+
| print dependency tree |`ionic_print_original_dependency_tree`|`--printOriginalDependencyTree`|`null`| Set to `true` to print out the original dependency tree calculated during the optimize step |
135
+
| print modified dependency tree |`ionic_print_modified_dependency_tree`|`--printModifiedDependencyTree`|`null`| Set to `true` to print out the modified dependency tree after purging unused modules |
136
+
| print webpack dependency tree |`ionic_print_webpack_dependency_tree`|`--printWebpackDependencyTree`|`null`| Set to `true` to print out a dependency tree after running Webpack |
137
+
| experimental parse deeplink config |`ionic_experimental_parse_deeplinks`|`--experimentalParseDeepLinks`|`null`| Set to `true` to parse the Ionic 3.x deep links API for lazy loading (Experimental) |
138
+
| experimental manual tree shaking |`ionic_experimental_manual_treeshaking`|`--experimentalManualTreeshaking`|`null`| Set to `true` to purge unused Ionic components/code (Experimental) |
139
+
| experimental purge decorators |`ionic_experimental_purge_decorators`|`--experimentalPurgeDecorators`|`null`| Set to `true` to purge unneeded decorators to improve tree shakeability of code (Experimental) |
140
+
| experimental closure compiler |`ionic_use_experimental_closure`|`--useExperimentalClosure`|`null`| Set to `true` to use closure compiler to minify the final bundle |
141
+
| experimental babili |`ionic_use_experimental_babili`|`--useExperimentalBabili`|`null`| Set to `true` to use babili to minify es2015 code |
142
+
| convert bundle to ES5 |`ionic_build_to_es5`|`--buildToEs5`|`true`| Convert bundle to ES5 for for production deployments |
143
+
128
144
129
145
130
146
@@ -140,6 +156,9 @@ These environment variables are automatically set to [Node's `process.env`](http
140
156
|`IONIC_SRC_DIR`| The absolute path to the app's source directory. |
141
157
|`IONIC_WWW_DIR`| The absolute path to the app's public distribution directory. |
142
158
|`IONIC_BUILD_DIR`| The absolute path to the app's bundled js and css files. |
159
+
|`IONIC_TMP_DIR`| Temp directory for debugging generated/optimized code and various build tasks |
160
+
|`IONIC_NODE_MODULES_DIR`| The absolute path to the `node_modules` directory. |
161
+
|`IONIC_ANGULAR_DIR`| The absolute path to the `ionic-angular` node_module directory. |
143
162
|`IONIC_APP_SCRIPTS_DIR`| The absolute path to the `@ionic/app-scripts` node_module directory. |
144
163
|`IONIC_SOURCE_MAP_TYPE`| The Webpack `devtool` setting. `eval` and `source-map` are supported.|
145
164
|`IONIC_GENERATE_SOURCE_MAP`| Determines whether to generate a sourcemap or not. |
@@ -157,6 +176,16 @@ These environment variables are automatically set to [Node's `process.env`](http
157
176
|`IONIC_WEBPACK_FACTORY`| The absolute path to Ionic's `webpack-factory` script |
158
177
|`IONIC_WEBPACK_LOADER`| The absolute path to Ionic's custom webpack loader |
159
178
|`IONIC_BAIL_ON_LINT_ERROR`| Boolean determining whether to exit with a non-zero status code on error |
179
+
|`ionic_aot_write_to_disk`|`--aotWriteToDisk`|`null`| Set to `true` to write files to disk for debugging |
180
+
|`ionic_print_original_dependency_tree`| boolean to print out the original dependency tree calculated during the optimize step |
181
+
|`ionic_print_modified_dependency_tree`| boolean to print out the modified dependency tree after purging unused modules |
182
+
|`ionic_print_webpack_dependency_tree`| boolean to print out a dependency tree after running Webpack |
183
+
|`ionic_experimental_parse_deeplinks`| boolean to enable parsing the Ionic 3.x deep links API for lazy loading (Experimental) |
184
+
|`ionic_experimental_manual_treeshaking`| boolean to enable purging unused Ionic components/code (Experimental) |
185
+
|`ionic_experimental_purge_decorators`| boolean to enable purging unneeded decorators from source code (Experimental) |
186
+
|`ionic_use_experimental_closure`| boolean to enable use of closure compiler to minify the final bundle |
187
+
|`ionic_use_experimental_babili`| boolean to enable use of babili to minify es2015 code |
188
+
|`ionic_build_to_es5`| boolean to enable converting bundle to ES5 for for production deployments |
160
189
161
190
162
191
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` and `serve` tasks produce `dev` builds (a build that does not include Ahead of Time (AoT) compilation or minification). To force a `prod` build you should use the `--prod` command line flag.
@@ -202,7 +231,7 @@ Example NPM Script:
202
231
```
203
232
npm run lint --bailOnLintError true
204
233
```
205
-
234
+
3. Set `ionic_experimental_manual_treeshaking` and `ionic_experimental_purge_decorators` to true in the `package.json` to potentially dramatically shrink an app's bundle size.
0 commit comments