Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 1baf159

Browse files
committed
chore(config): update configuration that are exposed and update readme
update configuration that are exposed and update readme
1 parent 5fe21f3 commit 1baf159

File tree

2 files changed

+67
-87
lines changed

2 files changed

+67
-87
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ npm run build --rollup ./config/rollup.config.js
9191

9292
| Config File | package.json Config | Cmd-line Flag |
9393
|-------------|---------------------|-----------------------|
94+
| Babili | `ionic_exp_babili` | `--babili` |
9495
| CleanCss | `ionic_cleancss` | `--cleancss` or `-e` |
9596
| Copy | `ionic_copy` | `--copy` or `-y` |
9697
| Closure | `ionic_closure` | `--closure` or `-l` |
@@ -112,6 +113,10 @@ npm run build --rollup ./config/rollup.config.js
112113
| src directory | `ionic_src_dir` | `--srcDir` | `src` | The directory holding the Ionic src code |
113114
| www directory | `ionic_www_dir` | `--wwwDir` | `www` | The deployable directory containing everything needed to run the app |
114115
| build directory | `ionic_build_dir` | `--buildDir` | `build` | The build process uses this directory to store generated files, etc |
116+
| temp directory | `ionic_tmp_dir` | `--tmpDir` | `.tmp` | Temporary directory for writing files for debugging and various build tasks |
117+
| node_modules directory | `ionic_node_modules_dir` | `--nodeModulesDir` | `node_modules` | Node modules directory |
118+
| ionic-angular directory | `ionic_angular_dir` | `--ionicAngularDir` | `ionic-angular` | ionic-angular directory |
119+
| ionic-angular entry point | `ionic_angular_entry_point` | `--ionicAngularEntryPoint` | `index.js` | entry point file for ionic-angular |
115120
| bundler | `ionic_bundler` | `--bundler` | `webpack` | Chooses which bundler to use: `webpack` or `rollup` |
116121
| source map type | `ionic_source_map_type` | `--sourceMapType` | `source-map` | Chooses the webpack `devtool` option. `eval` and `source-map` are supported |
117122
| 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
125130
| output css file | `ionic_output_css_file_name` | `--outputCssFileName` | `main.css` | name of css file generated in `buildDir` |
126131
| output css map file | `ionic_output_css_map_file_name` | `--outputCssMapFileName` | `main.css.map` | name of css source map file generated in `buildDir` |
127132
| 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+
128144

129145

130146

@@ -140,6 +156,9 @@ These environment variables are automatically set to [Node's `process.env`](http
140156
| `IONIC_SRC_DIR` | The absolute path to the app's source directory. |
141157
| `IONIC_WWW_DIR` | The absolute path to the app's public distribution directory. |
142158
| `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. |
143162
| `IONIC_APP_SCRIPTS_DIR` | The absolute path to the `@ionic/app-scripts` node_module directory. |
144163
| `IONIC_SOURCE_MAP_TYPE` | The Webpack `devtool` setting. `eval` and `source-map` are supported.|
145164
| `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
157176
| `IONIC_WEBPACK_FACTORY` | The absolute path to Ionic's `webpack-factory` script |
158177
| `IONIC_WEBPACK_LOADER` | The absolute path to Ionic's custom webpack loader |
159178
| `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 |
160189

161190

162191
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:
202231
```
203232
npm run lint --bailOnLintError true
204233
```
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.
206235

207236
## The Stack
208237

0 commit comments

Comments
 (0)