v0.11.0
Breaking Changes:
- Replaced the deprecated
autoprefixer-loader
withpostcss-loader
in default style pipelines - it's configured to do the same autoprefixing by default [#57]- If you were configuring vendor prefixing using
webpack.loaders.autoprefixer
, you will now need to manage anautprefixer
dependency yourself and usewebpack.postcss
to perform this configuration.
- If you were configuring vendor prefixing using
nwb.config.js
Config Format Changes:
For deprecations, nwb v0.11 will support the old format and display warning messages about the changes required.
-
webpack.plugins
is deprecated - config underwebpack.plugins
should be moved up intowebpack
instead. Having certain config under aplugins
prop was an implementation detail which wasn't relevant to end-users [#113]// < v0.11 module.exports = { webpack: { plugins: { define: {...}, html: {...} } } }
// v0.11 module.exports = { webpack: { define: {...}, html: {...} } }
-
Support for flatter Webpack loader configuration was added. Having a
query
object is now optional - loader query configuration can now be placed directly under the loader's id [#113]// < v0.11 module.exports = { webpack: { loaders: { css: { query: { modules: true } } } } }
// v0.11 module.exports = { webpack: { loaders: { css: { modules: true } } } }
Added:
- Installing globally now adds a
react
command for quick React development starting from a single file.react run entry.js
runs a development server.react build entry.js
creates a static build.- For these commands, Babel is preconfigured to allow you to use all of its Stage 0 features out of the box, including
async
/await
. - These are implemented by (the previously undocumented)
serve-react
and (new)build-react
nwb commands.
- The entry point for apps and npm module UMD builds can now be specified as an argument to
build
andserve
commands. The default is stillsrc/index.js
. [#115] - The directory web apps are built into can now be specified as an argument to
build
,clean
andserve
commands. The default is stilldist/
. - Added
webpack.compat
config to enable compatibility tweaks for modules which are known to be problematic with Webpack - initially this includes support for Enzyme, Moment.js and Sinon.js 1.x [#108] - Added
webpack.postcss
config to customise the PostCSS plugins applied to each style pipeline [#57] - Added
webpack.vendorBundle
config to disable automatically extracting anything imported fromnode_modules/
out into a separatevendor
chunk [#106] - Added documentation for creating and using a test context module if there's code you need to run prior to tests running, such as configuring your assertion library with additional assertions.
- Added a
--config
option to allow you to specify your own config file instead ofnwb.config.js
.
Changed:
- Apps are no longer required to provide their own HTML template. The default template path of
src/index.html
will continue to be used if a file exists there. If an alternative template is not provided viawebpack.html
config, nwb will now fall back to using a basic template. - Restored default use of the Babel polyfill in Karma config so tests (and their dependencies) can assume a modern environment.
- Default
babel-loader
config now usescacheDirectory: true
for a speedup. - Improved debug output (activated with a
DEBUG=nwb
environment variable) to print config objects in full - if you're configuring plugin objects (e.g. PostCSS plugins), it's recommended to create instances of them if you want to use debug output. webpack.optimize.DedupePlugin
is now only used for production builds, as recommended in the Webpack docs.
Dependencies:
- diff: v2.2.2 → v2.2.3
- html-webpack-plugin: v2.17.0 → v2.19.0
- inquirer: v1.0.2 → v1.0.3
- mocha: v2.4.5 → v2.5.3
- npm-install-webpack-plugin: v3.1.2 → v4.0.1 - saving is on by default and a new
dev
option controls where installed dependencies get saved to - redbox-noreact: v1.0.0 → v1.1.0
- webpack: v1.13.0 → v1.13.1
- webpack-merge: v0.12.0 → v0.14.0