Skip to content

Commit

Permalink
Add temporary workaround to fix broken common js import of mini-css-e…
Browse files Browse the repository at this point in the history
…xtract-plugin (#38004)

* update mini-css-extract-plugin to version 2.5.0

* fix add temporary workarround for mini-css-extract-plugin

* fix cover both types of import

* Save changes applied to the npm lock file

* Add changelog entry

* Improve comments

* Update CHANGELOG.md

Co-authored-by: Grzegorz Ziolkowski <[email protected]>
  • Loading branch information
fabiankaegy and gziolo authored Jan 17, 2022
1 parent 8ecd66a commit dbfe273
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 29 deletions.
64 changes: 37 additions & 27 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 `read-pkg-up` dependency has been updated from requiring `^1.0.1` to requiring `^7.0.1` ([#37395](https://github.com/WordPress/gutenberg/pull/37395)).

### Bug Fixes

- Added temporary workaround to fix broken CommonJS import of `mini-css-extract-plugin` [#38004](https://github.com/WordPress/gutenberg/pull/38004).

## 19.2.0 (2021-11-15)

### New Features
Expand Down
9 changes: 8 additions & 1 deletion packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ const { BundleAnalyzerPlugin } = require( 'webpack-bundle-analyzer' );
const { CleanWebpackPlugin } = require( 'clean-webpack-plugin' );
const CopyWebpackPlugin = require( 'copy-webpack-plugin' );
const browserslist = require( 'browserslist' );
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' );

/*
* Temporary workaround to fix broken CommonJS import in version 2.5.0.
* @see https://github.com/WordPress/gutenberg/issues/37992
*/
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' ).default
? require( 'mini-css-extract-plugin' ).default
: require( 'mini-css-extract-plugin' );
const { basename, dirname, resolve } = require( 'path' );
const ReactRefreshWebpackPlugin = require( '@pmmmwh/react-refresh-webpack-plugin' );
const TerserPlugin = require( 'terser-webpack-plugin' );
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"markdownlint": "^0.23.1",
"markdownlint-cli": "^0.27.1",
"merge-deep": "^3.0.3",
"mini-css-extract-plugin": "^2.1.0",
"mini-css-extract-plugin": "^2.5.0",
"minimist": "^1.2.0",
"npm-package-json-lint": "^5.0.0",
"npm-packlist": "^3.0.0",
Expand Down

0 comments on commit dbfe273

Please sign in to comment.