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

Commit a69afe0

Browse files
committed
chore(readme): improve readme w/ additional details for custom configurations
improve readme w/ additional details for custom configurations
1 parent efaf655 commit a69afe0

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,20 @@ npm run build
5151
```
5252

5353

54-
## Custom Config Files
54+
## Custom Configuration
5555

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.
5757

5858
[Default Config Files](https://github.com/driftyco/ionic-app-scripts/tree/master/config)
5959

6060
### package.json Config
6161

62-
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`.
6363

6464
```
6565
"config": {
66-
"ionic_rollup": "./config/rollup.config.js",
66+
"ionic_bundler": "rollup",
67+
"ionic_source_map": "source-map",
6768
"ionic_cleancss": "./config/cleancss.config.js"
6869
},
6970
```
@@ -103,14 +104,15 @@ npm run build --rollup ./config/rollup.config.js
103104

104105
### Overriding Config Values
105106

106-
| Config Values | package.json Config | Cmd-line Flag | Defaults |
107-
|-----------------|---------------------|---------------|-----------------|
108-
| bundler | `ionic_bundler` | `--bundler` | `webpack` |
109-
| source map type | `ionic_source_map` | `--sourceMap` | `eval` |
110-
| root directory | `ionic_root_dir` | `--rootDir` | `process.cwd()` |
111-
| tmp directory | `ionic_tmp_dir` | `--tmpDir` | `.tmp` |
112-
| www directory | `ionic_www_dir` | `--wwwDir` | `www` |
113-
| build directory | `ionic_build_dir` | `--buildDir` | `build` |
107+
| Config Values | package.json Config | Cmd-line Flag | Defaults | Details |
108+
|-----------------|---------------------|---------------|-----------------|----------------|
109+
| 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 |
114116

115117

116118
### Ionic Environment Variables
@@ -126,6 +128,7 @@ These environment variables are automatically set to [Node's `process.env`](http
126128
| `IONIC_WWW_DIR` | The absolute path to the app's public distribution directory. |
127129
| `IONIC_BUILD_DIR` | The absolute path to the app's bundled js and css files. |
128130
| `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`. |
129132

130133
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`.
131134

@@ -175,10 +178,10 @@ Example NPM Script:
175178
- [CleanCss](https://github.com/jakubpawlowicz/clean-css)
176179
- [TSLint](http://palantir.github.io/tslint/)
177180

178-
179-
180181
## Contributing
181182

183+
We welcome any PRs, issues, and feedback! Please be respectful and follow the [Code of Conduct]().
184+
182185
### Publish a release
183186

184187
Execute the following steps to publish a release:

0 commit comments

Comments
 (0)