Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Breaking: copy-webpack-plugin has breaking config changes in both its patterns and options
  • Loading branch information
insin committed May 17, 2020
1 parent c8e9dbf commit d028177
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
8 changes: 6 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
- Node.js 8 is no longer supported; Node.js 10.13.0 is now the minimum required version, as per many of nwb's dependencies.
- Removed support for deprecated `babel.stage` and `webpack.uglify` config.
- Removed default polyfills for `Promise`, `fetch()` and `Object.assign()` and deprecated `polyfill` config.
- If you need to support older browsers, you will need to provide the necessary polyfills yourself.
- If you need to support older browsers, you will now need to provide the necessary polyfills yourself in your app.
- The [react-app-polyfill](https://github.com/facebook/create-react-app/tree/master/packages/react-app-polyfill#react-app-polyfill) module provides polyfills for IE 9-11, and for stable language features - its instructions also work for apps using nwb.
- Deprecated using a string for [`webpack.autoprefixer` config](https://github.com/insin/nwb/blob/master/docs/Configuration.md#autoprefixer-object) to configure supported browsers - this will no longer do anything and should be moved to the new [`browsers` config](https://github.com/insin/nwb/blob/master/docs/Configuration.md#browsers-string--arraystring--object).
- Default browser configuration for Autoprefixer when building an app has changed from [`>1%, last 4 versions, Firefox ESR, not ie < 9`](https://browserl.ist/?q=%3E1%25%2C+last+4+versions%2C+Firefox+ESR%2C+not+ie+%3C+9) to [`>0.2%, not dead, not op_mini all`](https://browserl.ist/?q=%3E0.2%25%2C+not+dead%2C+not+op_mini+all).
- copy-webpack-plugin v6.0.0 [has breaking changes to its options](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md#600-2020-05-15) which you should read if you've configured the [`webpack.copy` option](https://github.com/insin/nwb/blob/master/docs/Configuration.md#copy-array--object).

In particular, the `ignore` option in a copy pattern must now be put inside the new `globOptions` option.
- file-loader v6.0.0 [changed its default hashing algorithm](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md#600-2020-03-17).

## Added
Expand All @@ -22,9 +25,10 @@
## Dependencies

- chalk: v3.0.0 → [v4.0.0](https://github.com/chalk/chalk/releases/tag/v4.0.0)
- copy-webpack-plugin: v5.1.1 → [v6.0.1](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md#601-2020-05-16)
- file-loader: v4.3.0 → [v6.0.0](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md#600-2020-03-17)
- fs-extra: v8.1.0 → [v9.0.0](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md#900--2020-03-19)
- karma: v4.4.1 → [v5.0.5](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md#505-2020-05-07)
- karma: v4.4.1 → [v5.0.7](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md#507-2020-05-16)
- karma-mocha: v1.3.0 → [v2.0.1](https://github.com/karma-runner/karma-mocha/blob/master/CHANGELOG.md#201-2020-04-29)
- terser-webpack-plugin v2.3.6 → [v3.0.1](https://github.com/webpack-contrib/terser-webpack-plugin/blob/master/CHANGELOG.md#301-2020-05-06)
- url-loader: v2.3.0→ [v4.1.0](https://github.com/webpack-contrib/url-loader/blob/master/CHANGELOG.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/Features.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Features

- **A toolkit, not a boilerplate.**
- Uses [Webpack 4](https://webpack.js.org/), [Babel 7](https://babeljs.io/) and [Karma 4](https://karma-runner.github.io/).
- Uses [Webpack 4](https://webpack.js.org/), [Babel 7](https://babeljs.io/) and [Karma 5](https://karma-runner.github.io/).
- Provides tooling for [React](https://facebook.github.io/react/) apps and components, [Preact](https://preactjs.com/) apps, [Inferno](https://infernojs.org/) apps, and vanilla JS web apps and npm modules.
- Use modern JavaScript features, and JSX.
- Use proposed JavaScript features now.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"babel-preset-proposals": "0.3.0",
"react-refresh": "0.8.2",

"karma": "5.0.5",
"karma": "5.0.7",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.0.2",
"karma-mocha": "2.0.1",
Expand All @@ -84,7 +84,7 @@
"autoprefixer": "9.7.6",
"babel-loader": "8.1.0",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"copy-webpack-plugin": "5.1.1",
"copy-webpack-plugin": "6.0.1",
"css-loader": "3.5.3",
"eventsource-polyfill": "0.9.6",
"file-loader": "6.0.0",
Expand Down
12 changes: 10 additions & 2 deletions src/appCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export function createBuildConfig(args: Object, extra: Object = {}) {
}

if (directoryExists('public')) {
config.plugins.copy = [{from: path.resolve('public'), to: dist, ignore: ['.gitkeep']}]
config.plugins.copy = [{
from: path.resolve('public'),
to: dist,
globOptions: {ignore: ['.gitkeep']}
}]
}

return merge(config, extra)
Expand All @@ -102,7 +106,11 @@ export function createServeConfig(args: Object, ...extra: Object[]) {
}

if (directoryExists('public')) {
config.plugins.copy = [{from: path.resolve('public'), to: dist, ignore: ['.gitkeep']}]
config.plugins.copy = [{
from: path.resolve('public'),
to: dist,
globOptions: {ignore: ['.gitkeep']}
}]
}

return merge(config, ...extra)
Expand Down
2 changes: 1 addition & 1 deletion src/createWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ export function createPlugins(
if (buildConfig.copy || userConfig.copy) {
const [patterns, options] = getCopyPluginArgs(buildConfig.copy, userConfig.copy)
if (patterns.length > 0) {
plugins.push(new CopyPlugin(patterns, options))
plugins.push(new CopyPlugin({patterns, options}))
}
}

Expand Down

0 comments on commit d028177

Please sign in to comment.