v0.8.0
Breaking Changes:
-
npm-install-webpack-plugin
is now used instead ofnpm-install-loader
to implementnwb serve --auto-install
.If you were configuring automatic npm installation using a
loaders.install.query.cli
config object, this should be moved towebpack.plugins.install
instead.
nwb.config.js
Format Changes:
nwb v0.8 will support the old format and display warning messages about the changes required before upgrading to nwb v0.9.
-
React component and vanilla JS module npm build configuration must now be specificed as a
build
object:// < v0.9 module.exports = { type: 'react-component', externals: {react: 'React'}, global: 'MyComponent', jsNext: true, umd: true }
// v0.9 module.exports = { type: 'react-component', build: { externals: {react: 'React'}, global: 'MyComponent', jsNext: true, umd: true } }
-
Webpack configuration must now be specified as a
webpack
object:// < v0.9 module.exports = { type: 'react-app', loaders: { css: { query: { modules: true } } } }
// v0.9 module.exports = { type: 'react-app', webpack: { loaders: { css: { query: { modules: true } } } } }
-
Webpack
define
config must now be specified in aplugins
object:// < v0.9 module.exports = { type: 'react-app', define: { __VERSION__: JSON.stringify(require('./package.json').version) } }
// v0.9 module.exports = { type: 'react-app', webpack: { plugins: { define: { __VERSION__: JSON.stringify(require('./package.json').version) } } } }
-
All "extra" Webpack config must be specified in a an
extra
object, including extra loaders. The new object must correspond with Webpack's config file layout.// < v0.9 module.exports = { type: 'react-app', loaders: { extra: [/* ... */] } }
// v0.9 module.exports = { type: 'react-app', webpack: { extra: { module: { loaders: [/* ... */] } } } }
Changes:
nwb.config.js
is now only required when running generic build commands:build
,clean
,serve
,test
type
config is only required when running a generic build command, but if provided it must be valid.
- Karma tests now always run just once in a CI environment regardless of the
--server
flag - this allows you to use--server
in your defaultnpm test
command if you want to, without needing a separate run script for CI. - Development instructions in project templates were moved from
README.md
to aCONTRIBUTING.md
file, and are now documented usingnpm
andnpm run
commands instead of globalnwb
commands. - All commands are now run in the current working directory - you no longer need to
require.resolve()
full paths to extra Babel plugins configured innwb.config.js
, just use their names as normal and Babel will now be able to import them. - Upgraded to PhantomJS v2 for Karma tests.
- Babel polyfills are no longer included in Webpack config for Karma, as PhantomJS v2 uses a more recent version of WebKit.
Added:
- Extra webpack config can now be configured via a
webpack.extra
Object.- To support adding other webpack built-in plugins via
extra
, if a function is exported fromnwb.config.js
, it will now be called with an object containing the following properties:command
- the nwb command being executedwebpack
- the webpack module (for configuring extra plugins using nwb's version of webpack)
- To support adding other webpack built-in plugins via
- Project type-specific versions of the
build
,clean
andserve
commands are now officially documented for direct use. - A
test:watch
npm script was added to project templatepackage.json
.
Dependencies:
- autoprefixer-loader: v3.1.0 → v3.2.0
- cross-spawn: v2.1.4 → v2.1.5 - update
which
dependency (minor) - expect: v1.13.4 → v1.14.0 - new features
- express: v4.13.3 → v4.13.4 - deps
- extract-text-webpack-plugin: v0.9.1 → v1.0.1 - use webpack-sources
- glob: v6.0.3 → v7.0.0 - throw if cwd is not a directory
- html-webpack-plugin: v1.7.0 → v2.9.0
- inquirer: v0.11.2 → v0.12.0
- karma: v0.13.18 → v0.13.21 - socket.io 1.4.5 seems to have fixed the post-test hanging issue, bug fixes and new features
- karma-mocha: v0.2.1 → v0.2.2
- karma-mocha-reporter: v1.1.5 → v1.2.2 - add diff output for failed tests
- karma-phantomjs-launcher: v0.2.3 → v1.0.0 - use phantomjs-prebuild
- mocha: v2.3.4 → v2.4.5
- phantomjs v1.9.19 → phantomjs-prebuilt v2.1.4 - update installer to PhantomJS 2.x, renamed package
- qs: v5.2.0 → v6.1.0 - revert ES6 requirement, new
allowDots
option and some fixes - react-transform-catch-errors: v1.0.1 → v1.0.2 - remove some files from the npm package
- react-transform-hmr: v1.0.1 → v1.0.2 - remove some files from the npm package
- resolve: v1.1.6 → v1.1.7 - fix
node_modules
paths on Windows - rimraf: v2.5.0 → v2.5.2
- webpack: v1.12.11 → v1.12.14 - fix Windows filename backslash incompatibility
- webpack-dev-middleware: v1.4.0 → v1.5.1 - platform-agnostic path joining, use
res.send
when available - webpack-hot-middleware: v2.6.0 → v2.7.1 - improve hint when hot reloads aren't accepted, update
strip-ansi
dependency (major), update stats handling