nwb v0.15.0 Release Notes
Release Date: 2017-01-25 // about 7 years ago-
๐ฅ Breaking Changes:
- โฌ๏ธ Upgraded from Webpack 1 to Webpack 2 [#110]
Minimum Node.js version increased from 4.2 to 4.3 - this is Webpack 2's minimum supported Node.js version.
Strict Webpack configuration - Webpack 2 is strict about what appears in its configuration object. If you're using
webpack.extra
config, it must conform to Webpack 2's configuration format or your build will fail with a validation error.Dropped CommonJS compatibility when importing ES modules - Webpack 2 no longer allows you to mix CommonJS modules with ECMAScript modules - if a module uses
import
orexport
syntax,exports
will beundefined
andmodule.exports
will be read-only andundefined
.As a result, we can no longer provide CommonJS interop by default for ES Modules - you will need to check your code for usage of CommonJS
require()
to import ES modules and tack a.default
on the end if you need to use the module'sexport default
.If you used nwb's Preact project skeleton, the
init()
function inindex.js
needs to have a.default
tacked on when theApp
component is being imported.Custom top-level properties no longer allowed in Webpack configuration - Webpack 2 no longer allows custom top-level properties in its configuration. Loader configuration which can't be serialised, such as plugin objects, can now be provided directly as loader options instead using
webpack.rules
config instead.This includes
postcss-loader
, which is now configured viawebpack.rules
instead of having its own specialwebpack.postcss
config.nwb.config.js
Config Format Changes:๐ > For deprecations, nwb will continue to support the old format for the next couple of releases, displaying warning messages about the changes required and adapting deprecated config for use in the current version where possible.
โก๏ธ > If you have an
nwb.config.js
file, runnwb check-config
after updating nwb to find out if there's anything you need to change.- ๐ง Deprecated
karma.testDirs
, renaming this config tokarma.excludeFromCoverage
, as it can be configured to exclude any paths from code coverage, not just directories [#236]
// < v0.15 // v0.15 module.exports = { module.exports = { karma: { karma: { testDirs: [ => excludeFromCoverage: [ 'test/', 'test/', 'path/to/ignorethis.js' 'path/to/ignorethis.js' ] ] } } } }
- ๐ Deprecated
webpack.loaders
, renaming this config towebpack.rules
to match Webpack 2's new config format:
// < v0.15 // v0.15 module.exports = { module.exports = { webpack: { webpack: { loaders: { => rules: { /* ... */ /* ... */ } } } } } }
- ๐ง Deprecated use of a
query
property to configure Webpack rule options as a separate object - anoptions
property should now be used as per Webpack 2's new config format:
// < v0.15 // v0.15 module.exports = { module.exports = { webpack: { webpack: { loaders: { rules: { css: { css: { query: { => options: { modules: /* ... */ modules: /* ... */ } } } } } } } } } }
You can also still configure loader options as a flat object to make this particular change irrelevant:
module.exports = { webpack: { rules: { css: { modules: /* ... */ } } } }
- ๐ง Deprecated configuring PostCSS plugins with special
webpack.postcss
config - postcss-loader can now be configured like any other loader usingwebpack.rules
config:
// < v0.15 // v0.15 module.exports = { module.exports = { webpack: { webpack: { postcss: [ => rules: { require('precss')(), postcss: { require('autoprefixer')() plugins: [ ] require('precss')(), } require('autoprefixer')() } ] } } } }
โ Removed:
- โ Removed support for configuration which was deprecated in nwb v0.12.
- โ Removed support for
json-schema
inwebpack.compat
config, as this library has now been fixed [#227]
Dependencies:
- autoprefixer: v6.6.1 โ v6.7.0
- babel-cli: v6.18.0 โ v6.22.2
- babel-core: v6.21.0 โ v6.22.1
- ๐ babel-plugin-inferno: v1.5.0 โ v1.7.0 - make plugin ES5-environment compatible; add option to import
createVNode
- ๐ babel-plugin-transform-react-jsx: v6.8.0 โ v6.22.0
- ๐ babel-plugin-transform-react-jsx-self: v6.11.0 โ v6.22.0
- ๐ babel-plugin-transform-react-jsx-source: v6.9.0 โ v6.22.0
- ๐ babel-plugin-transform-runtime: v6.15.0 โ v6.22.0
- babel-polyfill: v6.20.0 โ v6.22.0
- babel-preset-es2015: v6.18.0 โ v6.22.0
- babel-preset-es2016: v6.16.0 โ v6.22.0
- babel-preset-react : v6.16.0 โ v6.22.0
- babel-preset-stage-0: v6.16.0 โ v6.22.0
- babel-preset-stage-1: v6.16.0 โ v6.22.0
- babel-preset-stage-2: v6.18.0 โ v6.22.0
- babel-preset-stage-3: v6.17.0 โ v6.22.0
- babel-runtime: v6.20.0 โ v6.22.0
- detect-port: v1.0.7 โ v1.1.0
- filesize: v3.3.0 โ v3.4.3
- ๐ html-webpack-plugin: v2.24.1 โ v2.26.0 - Webpack 2 RC support
- ๐ inquirer: v2.0.0 โ v3.0.1 - drop Node.js 0.12 support
- karma: v1.3.0 โ v1.4.0
- karma-mocha-reporter: v2.2.1 โ v2.2.2
- ๐ karma-webpack: v1.8.0 โ v2.0.1 - Webpack 2 RC support
- object-assign: v4.1.0 โ v4.1.1
- ora: v0.4.1 โ v1.1.0 - text can now be changed while stopping and persisting
- postcss-loader: v1.2.1 โ v1.2.2
- ๐ webpack: v1.14.0 โ v2.2.0 - \o/
- ๐ webpack-merge: v2.3.1 โ v2.4.0
- ๐ whatwg-fetch: v2.0.1 โ v2.0.2
Temporarily Scoped Dependencies:
๐ These are being scoped to both make use of unreleased features and to test them out:
- ๐ @insin/extract-text-webpack-plugin - scoped until this PR is merged and released
- ๐ @insin/npm-install-webpack-plugin - scoped until new features are merged and released
Internal:
- โฌ๏ธ Dropped unused
fs-extra
dependency. - ๐ Use
babel-preset-env
when transpiling tolib/
, targeting Node.js 4 [#233] - ๐ Use ES2015
String
methods available in Node.js 4 instead ofString.prototype.indexOf
comparisons [#222]