@io-arc/webpack-settings
webpack build settings.
Usage#
index.ts
Variables#
jsOptimization#
Return: webpack.Options.Optimization
Get minify and common logic extraction settings for Babel, TypeScript, and JavaScript frameworks.
The following information will be read automatically.
- Configuration > Build > options.js.minify
- Configuration > Build > options.js.teaser
- Configuration > Build > options.js.splitFilename
webpackDefine#
Global constant.
Use with webpack.DefinePlugin.
Return: object
| const | type | description |
|---|---|---|
IS_PRODUCTION | boolean | Whether the build mode is NODE_ENV=production or not |
SITE_TITLE | string | Configuration > Site > title |
SITE_URL | string | Configuration > Site > url |
SITE_AUTHOR | string | Configuration > Site > author |
SITE_ROOT | string | Configuration > Site > siteRoot |
example
webpack.config.ts
Functions#
stats(stats)#
Return: webpack.Configuration['stats']
A webpack parameter settings.
Parameter types reference to webpack stats
Parameters
| params | type | default | description |
|---|---|---|---|
stats (optional) | boolean | 'normal' | 'none' | 'verose' | 'errors-only' | 'errors-warnings | 'minimal' | Configuration['stats'] | undefined | (*1) | webpack stats settings |
(*1) Default
performance(performance)#
Return: webpack.Configuration['performance']
A webpack performance settings.
Parameter types reference to webpack performance
Parameters
| params | type | default | description |
|---|---|---|---|
performance (optional) | false | Configuration['performance'] | undefined | (*2) | webpack performance |
(*2) Default
progressBar(task)#
Return: {format: string; clear: boolean}
Using progress-bar-webpack-plugin.
Install required npm i -D progress-bar-webpack-plugin.
Parameters
| params | type | default | description |
|---|---|---|---|
task | string | - | Task name |