Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
- The bundled `@svgr/webpack` dependency has been updated from requiring `^5.2.0` to requiring `^5.5.0` ([#33818](https://github.com/WordPress/gutenberg/pull/33818)).
- The bundled `webpack-bundle-analyzer` dependency has been updated from requiring `^4.2.0` to requiring `^4.4.2` ([#33818](https://github.com/WordPress/gutenberg/pull/33818)).

### Bug Fixes

- Add missing fallback for target in webpack 5 config ([#34112](https://github.com/WordPress/gutenberg/pull/34112)),

## 17.1.0 (2021-07-29)

### Enhancements
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/config/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends @wordpress/browserslist-config
8 changes: 7 additions & 1 deletion packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const LiveReloadPlugin = require( 'webpack-livereload-plugin' );
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' );
const TerserPlugin = require( 'terser-webpack-plugin' );
const { CleanWebpackPlugin } = require( 'clean-webpack-plugin' );
const browserslist = require( 'browserslist' );
const path = require( 'path' );

/**
Expand All @@ -18,13 +19,18 @@ const postcssPlugins = require( '@wordpress/postcss-plugins-preset' );
* Internal dependencies
*/
const {
fromConfigRoot,
hasBabelConfig,
hasCssnanoConfig,
hasPostCSSConfig,
} = require( '../utils' );

const isProduction = process.env.NODE_ENV === 'production';
const mode = isProduction ? 'production' : 'development';
let target = 'browserslist';
if ( ! browserslist.findConfig( '.' ) ) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the same trick in @wordpress/babel-config-default:

const localBrowserslistConfig =
browserslist.findConfig( '.' ) || {};
opts.targets = {
browsers:
localBrowserslistConfig.defaults ||
require( '@wordpress/browserslist-config' ),
};

target += ':' + fromConfigRoot( '.browserslistrc' );
}

const cssLoaders = [
{
Expand Down Expand Up @@ -81,7 +87,7 @@ const getLiveReloadPort = ( inputPort ) => {

const config = {
mode,
target: 'browserslist',
target,
entry: {
index: path.resolve( process.cwd(), 'src', 'index.js' ),
},
Expand Down
2 changes: 2 additions & 0 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dependencies": {
"@svgr/webpack": "^5.5.0",
"@wordpress/babel-preset-default": "file:../babel-preset-default",
"@wordpress/browserslist-config": "file:../browserslist-config",
"@wordpress/dependency-extraction-webpack-plugin": "file:../dependency-extraction-webpack-plugin",
"@wordpress/eslint-plugin": "file:../eslint-plugin",
"@wordpress/jest-preset-default": "file:../jest-preset-default",
Expand All @@ -43,6 +44,7 @@
"@wordpress/stylelint-config": "file:../stylelint-config",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"browserslist": "^4.16.6",
"chalk": "^4.0.0",
"check-node-version": "^4.1.0",
"clean-webpack-plugin": "^3.0.0",
Expand Down