Skip to content

Commit 14e6a2c

Browse files
committed
docs: general formatting clean up
Mostly clean up of tables so they're a little less noisy and easier to read. I'm slowly trying to enforce a single syntax for tables throughout the whole site (would be great if we could lint this). Also formatted certain things as code and cleaned up wording in a few places.
1 parent 9fe3884 commit 14e6a2c

File tree

2 files changed

+84
-84
lines changed

2 files changed

+84
-84
lines changed

src/content/api/cli.md

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,30 @@ webpack --env.platform=web # sets env.platform == "web"
130130

131131
The `--env` argument accepts various syntaxes:
132132

133-
| Invocation | Resulting environment |
134-
|-------------------------------|-----------------------------|
135-
| webpack --env prod | `"prod"` |
136-
| webpack --env.prod | `{ prod: true }` |
137-
| webpack --env.prod=1 | `{ prod: 1 }` |
138-
| webpack --env.prod=foo | `{ prod: "foo" }` |
139-
| webpack --env.prod --env.min | `{ prod: true, min: true }` |
140-
| webpack --env.prod --env min | `[{ prod: true }, "min"]` |
133+
Invocation | Resulting environment
134+
------------------------------- | ---------------------------
135+
`webpack --env prod` | `"prod"`
136+
`webpack --env.prod` | `{ prod: true }`
137+
`webpack --env.prod=1` | `{ prod: 1 }`
138+
`webpack --env.prod=foo` | `{ prod: "foo" }`
139+
`webpack --env.prod --env.min` | `{ prod: true, min: true }`
140+
`webpack --env.prod --env min` | `[{ prod: true }, "min"]`
141141

142142
### Output Options
143143

144144
This set of options allows you to manipulate certain [output](/configuration/output) parameters of your build.
145145

146-
| Parameter | Explanation | Input type | Default value |
147-
|------------------------------|-----------------------------------------------------------------|------------|-------------------------------------------------------|
148-
| --output-chunk-filename | The output filename for additional chunks | string | filename with [id] instead of [name] or [id] prefixed |
149-
| --output-filename | The output filename of the bundle | string | [name].js |
150-
| --output-jsonp-function | The name of the JSONP function used for chunk loading | string | webpackJsonp |
151-
| --output-library | Expose the exports of the entry point as library | string | |
152-
| --output-library-target | The type for exposing the exports of the entry,point as library | string | var |
153-
| --output-path | The output path for compilation assets | string | Current directory |
154-
| --output-pathinfo | Include a comment with the request for every dependency | boolean | false |
155-
| --output-public-path | The public path for the assets | string | / |
156-
| --output-source-map-filename | The output filename for the SourceMap | string | [name].map or [outputFilename].map |
146+
Parameter | Explanation | Input type | Default
147+
------------------------- | ------------------------------------------- | ---------- | ------------------
148+
`--output-chunk-filename` | The output filename for additional chunks | string | filename with [id] instead of [name] or [id] prefixed
149+
`--output-filename` | The output filename of the bundle | string | [name].js
150+
`--output-jsonp-function` | The name of the JSONP function used for chunk loading | string | webpackJsonp
151+
`--output-library` | Expose the exports of the entry point as library | string |
152+
`--output-library-target` | The type for exposing the exports of the entry,point as library | string | var
153+
`--output-path` | The output path for compilation assets | string | Current directory
154+
`--output-pathinfo` | Include a comment with the request for every dependency | boolean | false
155+
`--output-public-path` | The public path for the assets | string | /
156+
`--output-source-map-filename` | The output filename for the SourceMap | string | [name].map or [outputFilename].map
157157

158158

159159
#### Example Usage
@@ -189,104 +189,104 @@ webpack.js index=./src/index.js index2=./src/index2.js --output-path='./dist' --
189189

190190
This set of options allows you to better debug the application containing assets compiled with webpack
191191

192-
| Parameter | Explanation | Input type | Default value |
193-
|------------|--------------------------------------------------|------------|---------------|
194-
| --debug | Switch loaders to debug mode | boolean | false |
195-
| --devtool | Define [source map type](/configuration/devtool/) for the bundled resources | string | - |
196-
| --progress | Print compilation progress in percentage | boolean | false |
192+
Parameter | Explanation | Input type | Default value
193+
------------ | ------------------------------------------------ | ---------- | -------------
194+
`--debug` | Switch loaders to debug mode | boolean | false
195+
`--devtool` | Define [source map type](/configuration/devtool/) for the bundled resources | string | -
196+
`--progress` | Print compilation progress in percentage | boolean | false
197197

198198

199199
### Module Options
200200

201201
These options allow you to bind [modules](/configuration/module/) as allowed by webpack
202202

203-
| Parameter | Explanation | Usage |
204-
|--------------------|------------------------------------|-----------------------------|
205-
| --module-bind | Bind an extension to a loader | --module-bind js=babel-loader |
206-
| --module-bind-post | Bind an extension to a post loader | |
207-
| --module-bind-pre | Bind an extension to a pre loader | |
203+
Parameter | Explanation | Usage
204+
-------------------- | ---------------------------------- | ----------------
205+
`--module-bind` | Bind an extension to a loader | `--module-bind js=babel-loader`
206+
`--module-bind-post` | Bind an extension to a post loader |
207+
`--module-bind-pre` | Bind an extension to a pre loader |
208208

209209

210210
### Watch Options
211211

212212
These options makes the build [watch](/configuration/watch/) for changes in files of the dependency graph and perform the build again.
213213

214-
| Parameter | Explanation |
215-
|---------------------------|---------------------------------------------------------|
216-
| --watch, -w | Watch the filesystem for changes |
217-
| --save, -s | Recompiles on save regardless of changes |
218-
| --watch-aggregate-timeout | Timeout for gathering changes while watching |
219-
| --watch-poll | The polling interval for watching (also enable polling) |
220-
| --watch-stdin, --stdin | Exit the process when stdin is closed |
214+
Parameter | Explanation
215+
------------------------- | ----------------------
216+
`--watch`, `-w` | Watch the filesystem for changes
217+
`--save`, `-s` | Recompiles on save regardless of changes
218+
`--watch-aggregate-timeout` | Timeout for gathering changes while watching
219+
`--watch-poll` | The polling interval for watching (also enable polling)
220+
`--watch-stdin`, `--stdin` | Exit the process when stdin is closed
221221

222222

223223
### Optimize Options
224224

225225
These options allow you to manipulate optimisations for a production build using webpack
226226

227-
| Parameter | Explanation | Plugin used |
228-
|---------------------------|--------------------------------------------------------|--------------------------------------|
229-
| --optimize-max-chunks | Try to keep the chunk count below a limit | [LimitChunkCountPlugin](/plugins/limit-chunk-count-plugin) |
230-
| --optimize-min-chunk-size | Try to keep the chunk size above a limit | [MinChunkSizePlugin](/plugins/min-chunk-size-plugin) |
231-
| --optimize-minimize | Minimize javascript and switches loaders to minimizing | [UglifyJsPlugin](/plugins/uglifyjs-webpack-plugin/) & [LoaderOptionsPlugin](/plugins/loader-options-plugin/) |
227+
Parameter | Explanation | Plugin Used
228+
--------------------------- | -------------------------------------------------------|----------------------
229+
`--optimize-max-chunks` | Try to keep the chunk count below a limit | [LimitChunkCountPlugin](/plugins/limit-chunk-count-plugin)
230+
`--optimize-min-chunk-size` | Try to keep the chunk size above a limit | [MinChunkSizePlugin](/plugins/min-chunk-size-plugin)
231+
`--optimize-minimize` | Minimize javascript and switches loaders to minimizing | [UglifyJsPlugin](/plugins/uglifyjs-webpack-plugin/) & [LoaderOptionsPlugin](/plugins/loader-options-plugin/)
232232

233233

234234
### Resolve Options
235235

236236
These allow you to configure the webpack [resolver](/configuration/resolve/) with aliases and extensions.
237237

238-
| Parameter | Explanation | Example |
239-
|------------------------|---------------------------------------------------------|---------------------------------------------|
240-
| --resolve-alias | Setup a module alias for resolving | --resolve-alias jquery-plugin=jquery.plugin |
241-
| --resolve-extensions | Setup extensions that should be used to resolve,modules | --resolve-extensions .es6 .js .ts |
242-
| --resolve-loader-alias | Minimize javascript and switches loaders to minimizing | |
238+
Parameter | Explanation | Example
239+
---------------------- | ------------------------------------------------------- | -------------
240+
--resolve-alias | Setup a module alias for resolving | --resolve-alias jquery-plugin=jquery.plugin
241+
--resolve-extensions | Setup extensions that should be used to resolve,modules | --resolve-extensions .es6 .js .ts
242+
--resolve-loader-alias | Minimize javascript and switches loaders to minimizing |
243243

244244

245245
### Stats Options
246246

247247
These options allow webpack to display various [stats](/configuration/stats/) and style them differently in the console output.
248248

249-
| Parameter | Explanation | Type |
250-
|--------------------------------|--------------------------------------------------------------------|---------|
251-
| --color, --colors | Enables/Disables colors on the console [default: (supports-color)] | boolean |
252-
| --display | Select [display preset](/configuration/stats) (verbose, detailed, normal, minimal, errors-only, none; since webpack 3.0.0) | string |
253-
| --display-cached | Display also cached modules in the output | boolean |
254-
| --display-cached-assets | Display also cached assets in the output | boolean |
255-
| --display-chunks | Display chunks in the output | boolean |
256-
| --display-depth | Display distance from entry point for each module | boolean |
257-
| --display-entrypoints | Display entry points in the output | boolean |
258-
| --display-error-details | Display details about errors | boolean |
259-
| --display-exclude | Exclude modules in the output | boolean |
260-
| --display-max-modules | Sets the maximum number of visible modules in output | number |
261-
| --display-modules | Display even excluded modules in the output | boolean |
262-
| --display-optimization-bailout | Scope hoisting fallback trigger (since webpack 3.0.0) | boolean |
263-
| --display-origins | Display origins of chunks in the output | boolean |
264-
| --display-provided-exports | Display information about exports provided from modules | boolean |
265-
| --display-reasons | Display reasons about module inclusion in the output | boolean |
266-
| --display-used-exports | Display information about used exports in modules (Tree Shaking) | boolean |
267-
| --hide-modules | Hides info about modules | boolean |
268-
| --sort-assets-by | Sorts the assets list by property in asset | string |
269-
| --sort-chunks-by | Sorts the chunks list by property in chunk | string |
270-
| --sort-modules-by | Sorts the modules list by property in module | string |
271-
| --verbose | Show more details | boolean |
249+
Parameter | Explanation | Type
250+
-------------------------------- | ------------------------------------------------------------------ | -------
251+
`--color`, `--colors` | Enables/Disables colors on the console [default: (supports-color)] | boolean
252+
`--display` | Select [display preset](/configuration/stats) (verbose, detailed, normal, minimal, errors-only, none; since webpack 3.0.0) | string
253+
`--display-cached` | Display also cached modules in the output | boolean
254+
`--display-cached-assets` | Display also cached assets in the output | boolean
255+
`--display-chunks` | Display chunks in the output | boolean
256+
`--display-depth` | Display distance from entry point for each module | boolean
257+
`--display-entrypoints` | Display entry points in the output | boolean
258+
`--display-error-details` | Display details about errors | boolean
259+
`--display-exclude` | Exclude modules in the output | boolean
260+
`--display-max-modules` | Sets the maximum number of visible modules in output | number
261+
`--display-modules` | Display even excluded modules in the output | boolean
262+
`--display-optimization-bailout` | Scope hoisting fallback trigger (since webpack 3.0.0) | boolean
263+
`--display-origins` | Display origins of chunks in the output | boolean
264+
`--display-provided-exports` | Display information about exports provided from modules | boolean
265+
`--display-reasons` | Display reasons about module inclusion in the output | boolean
266+
`--display-used-exports` | Display information about used exports in modules (Tree Shaking) | boolean
267+
`--hide-modules` | Hides info about modules | boolean
268+
`--sort-assets-by` | Sorts the assets list by property in asset | string
269+
`--sort-chunks-by` | Sorts the chunks list by property in chunk | string
270+
`--sort-modules-by` | Sorts the modules list by property in module | string
271+
`--verbose` | Show more details | boolean
272272

273273

274274
### Advanced Options
275275

276-
| Parameter | Explanation | Usage |
277-
|-----------------------|------------------------------------------------------------------|---------------------------------------------|
278-
| --bail | Abort the compilation on first error | |
279-
| --cache | Enable in memory caching [Enabled by default for watch] | --cache=false |
280-
| --define | Define any free var in the bundle, see [shimming](/guides/shimming) | --define process.env.NODE_ENV='development' |
281-
| --hot | Enables [Hot Module Replacement](/concepts/hot-module-replacement) [Uses HotModuleReplacementPlugin] | --hot=true |
282-
| --labeled-modules | Enables labeled modules [Uses LabeledModulesPlugin] | |
283-
| --plugin | Load this [plugin](/configuration/plugins/) | |
284-
| --prefetch | Prefetch the particular file | --prefetch=./files.js |
285-
| --provide | Provide these modules as free vars in all modules, see [shimming](/guides/shimming) | --provide jQuery=jquery |
286-
| --records-input-path | Path to the records file (reading) | |
287-
| --records-output-path | Path to the records file (writing) | |
288-
| --records-path | Path to the records file | |
289-
| --target | The [targeted](/configuration/target/) execution environment | --target='node' |
276+
Parameter | Explanation | Usage
277+
----------------- | ---------------------------------------- | -----
278+
`--bail` | Abort the compilation on first error |
279+
`--cache` | Enable in memory caching [Enabled by default for watch] | `--cache=false`
280+
`--define` | Define any free variable, see [shimming](/guides/shimming) | `--define process.env.NODE_ENV='development'`
281+
`--hot` | Enables [Hot Module Replacement](/concepts/hot-module-replacement) | `--hot=true`
282+
`--labeled-modules` | Enables labeled modules [Uses LabeledModulesPlugin] |
283+
`--plugin` | Load this [plugin](/configuration/plugins/) |
284+
`--prefetch` | Prefetch the particular file | `--prefetch=./files.js`
285+
`--provide` | Provide these modules as globals, see [shimming](/guides/shimming) | `--provide jQuery=jquery`
286+
`--records-input-path` | Path to the records file (reading) |
287+
`--records-output-path` | Path to the records file (writing) |
288+
`--records-path` | Path to the records file |
289+
`--target` | The [targeted](/configuration/target/) execution environment | `--target='node'`
290290

291291
### Shortcuts
292292

src/content/guides/build-performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Decrease the total size of the compilation to increase build performance. Try to
7777

7878
### Worker Pool
7979

80-
The `thread-loader` can be used to offload expensive loaders to a worker pool.
80+
The `thread-loader` can be used to offload expensive loaders to a worker pool.
8181

8282
W> Don't use too many workers as there is a boot overhead for the Node.js runtime and the loader. Minimize the module transfers between worker and main process. IPC is expensive.
8383

0 commit comments

Comments
 (0)