webpack 4 config. demo :gear:
Demo project to start using and experiment with Webpack 4
Restore dependencies and start development server:
yarn && yarn dev
Check your browser console at localhost:8080
entry
/ output
custom config.app
| vendors
)yarn add webpack webpack-cli --dev
This project started with Webpack 4
in beta version:
# add webpack 4 (currently on 4.0.0-beta.2)
yarn add webpack@next webpack-cli --dev
No need for explicit specify entry
and output
properties in the webpack configuration.
In Webpack 4 those fields are defaulted to:
{
"entry": "./src",
"output": "./dist"
}
Webpack mode
reduce the required configuration for an useful build:
development
: this mode provide useful error messages and is optimized for speed (unminified bundle)production
: enables optimizations out of the box (scope hoisting, tree shaking, minification, etc.)webpack --mode production
There is also another hidden none
mode which disables everything (available only inside the configuration object).
CommonsChunkPlugin
was removed)MIT © Carloluis