A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)
OTHER License
Bot releases are hidden (Show)
Browser Support
Removed default polyfills for Promise
, fetch()
and Object.assign()
and deprecated polyfill
config.
If you need to support older browsers, you will now need to include the necessary polyfills in your app - see the new Browser Support docs for details on polyfilling and suggested modules which provide them.
If this change affects your app, a quick fix is to use react-app-polyfill's IE11 polyfill, which is equivalent to what nwb's default polyfill used to be:
import 'react-app-polyfill/ie11'
For apps and quick commands, @babel/preset-env
is now configured to only transpile the necessary ECMAScript 2015+ for supported browsers.
When running a development server, this defaults to the most recent version of Chrome, Firefox or Safari, so you may need to adjust browsers.development
config if you're using an out of date browser and you will need to adjust it if you're developing with an older browser supported by your app.
Default browser configuration for Autoprefixer when building an app has changed from >1%, last 4 versions, Firefox ESR, not ie < 9
to >0.2%, not dead, not op_mini all
.
When running a development server, the default browser configuration has changed to last 1 chrome version, last 1 firefox version, last 1 safari version
.
Configuration
Deprecated using a string for webpack.autoprefixer
config to configure supported browsers - this will no longer do anything and should be moved to the new browsers
config.
Removed support for babel.stage
and webpack.uglify
config deprecated in nwb v0.24.0.
copy-webpack-plugin v6.0.0 has breaking changes to its options which you should read if you're using webpack.copy
config.
In particular, the ignore
option in a copy pattern must now be put inside the new globOptions
option.
Dependencies
browsers
config to configure supported browsers. This supports using separate browserslist queries for development and production.__source
and __self
debugging information when transpiling JSX in react-component
projects by defaulting process.env.NODE_ENV
to 'production'
when building.html.minification = false
.lang
attribute on <html>
wasn't getting set to the default 'en'
when using the nwb react
, nwb preact
and nwb inferno
quick development commands.Added babel.react
config to configure @babel/preset-react
options, allowing you to opt-in to using the new automatic
runtime which was added in Babel v7.9.0.
For convenience, you can just configure the runtime name if you want to try it with the experimental version of React:
module.exports = {
babel: {
react: 'automatic'
}
}
nwb react run SomeComponent.js
) exists, to avoid a confusing error message [#441]quiet
option is set..test.js
/.spec.js
files when building a React component or web module by also passing the new --no-copy-ignored
flag when calling @babel/cli [#529]Demo
component in the template.Node.js 6 is no longer supported; Node.js 8.9.0 is now the minimum required version, as per many of nwb's dependencies.
Updated to Babel 7
babel.runtime
config no longer accepts a String
to enable an additional, named feature.
Pass an Object
with plugin options instead.
Support for tests in *-test.js
files has been removed, as @babel-core
no longer supports pattern matching them to ignore them when co-located in src/
.
Rename these to *.test.js
instead.
Dropped support for the old --no-hmre
alias to disable Hot Module Replacement, just use --no-hmr
instead.
Updated Preact config for Preact X.
Dependencies with (documented) breaking changes:
babel.proposals
config to configure use of Babel's proposal plugins.en
property to webpack.html
config to set the document language when using nwb's default HTML template [#520] [Muhnad]UglifyJsPlugin
with TerserWebpackPlugin
.preact/compat
is now part of the preact
module.Deprecated babel.stage
config, as Babel's stage-X
presets were/are being removed in Babel 7 - if you provide it, nwb will warn you and enable Babel proposal plugins equivalent to the current stage they're at.
Use babel.proposals
config instead if you want to toggle some or all additional proposal plugins on.
Deprecated webpack.uglify
config, which has been renamed to webpack.terser
.
Autoprefixer renamed its browsers
option to overrideBrowserslist
, so you will get deprecation warnings if you were using {browsers: ...}
in webpack.autoprefixer
config.
inferno-*
packages (such as inferno-compat
) work again with Webpack 4 [#440]prepublishOnly
to react-component and web-module project package.json scripts, which invokes npm run build
prior to publishing [#436] [hanford]npm.umd.entry
config to specify a different entry point for the UMD build in npm module projects. Currently, the UMD build requires an entry point which must have a default
export [#411]CopyPlugin
when webpack.copy
config is provided [#431]nwb.config.js
, some of the nwb config you depended on may have changed, and the options Webpack accepts may have changed [#409]
mode
option is now set to activate Webpack 4's new defaults, which removes the need for a bunch of manual configuration nwb was doing:
ModuleConcatenationPlugin
is now automatically enabled in production
mode instead of being explicitly configured, so nwb's webpack.hoisting
config has been removed.NamedModulesPlugin
is now automatically used in development
mode instead of being explicitly configured.production
mode with minimization disabled, as the new development
mode defaults are unsuitable for code which will be published to npm.optimization
options are now used for certain pieces of configuration:
optimization.noEmitOnErrors
is used instead of NoEmitOnErrorsPlugin
to prevent emission of assets when using Hot Module Replacement.optimization.minimize
/optimization.minimizer
instead of just adding UglifyJsPlugin
directly to plugins
.CommonsChunkPlugin
has been removed in Webpack 4 - optimization.runtimeChunk
is now configured to create a runtime
chunk (which replaces the old manifest
chunk) and optimization.splitChunks
is configured to create a vendor
bundle.ExtractTextPlugin
with MiniCssExtractPlugin
:
webpack.extractText
config with webpack.extractCSS
config - this is not backwards-compatible, as plugin options differ.performance
option size warnings have been disabled (for now).nwb new inferno-app
now asks if you want to install inferno-compat
as it's no longer a single dependency, defaulting to not installing it.nwb new preact-app
now asks if you want to install preact-compat
, defaulting to not installing it.webpack.compat.enzyme
, webpack.compat.sinon
and webpack.style = 'old'
config..mjs
files to npm, which is breaking inferno-*
packages with Webpack 4, so e.g. inferno-compat
won't work if you want to reuse React components.-f/--force
flag to nwb new
to accept defaults and skip questions.index.html
serving can now be configured with dot arguments - e.g. pass --fallback.disableDotRule
if you need to use dots in your path when using the HTML5 History API.--no-polyfill
can now be used to disable default polyfills for app projects as well as quick commands.url()
sStatusPlugin
and InlineRuntimePlugin
to use the Use the new Webpack 4 .hooks
plugin API.publicPath
docs, as Webpack's output.publicPath
config can't be null
[#432] [stephenwf]nwb.config.js
files has been expanded, so previously valid config files may now be invalid [#136]
babel
, karma
, npm
and webpack
configuration (i.e. anything that's not documented in the Configuration docs) are now treated as errors [#193]nwb check-config
to check your configuration file.webpack.uglify
config you have against the new version's options documentation - options for UglifyJS itself must now be passed as an uglifyOptions
object and some of UglifyJS' default options have changed.engines
config of nwb's dependencies.nwb.config.js
Config Changeswebpack.compat.sinon
flag for Sinon 1.x compatibility settings, as subsequent major versions since July 2017 support Webpack out of the box.--open
flag to open the app in your default browser or in a named browser (e.g. --open="Google Chrome"
) after starting a Webpack dev server [#334]babel.config()
function which will be given the generated Babel config to do whatever it wants with.karma.config()
function which will be given the generated Karma config to do whatever it wants with [#408]webpack.compat
config
webpack.copy
config
--copy-files
for component builds more visible [#407]default
export of the entry point, rather than an ES modules interop object which looks something like {__esModule: true, default: Getter}
, which was unintended behaviour. This will break any existing usage of UMD builds which depended on manually accessing the unintended default
property [#402]16.x
- fixes creating components with npm 2.--unsafe-perm
workaround for PhantomJS' postinstall step failing on some OSes when installing globally with npm 5 [#383]