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)
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.