Skip to content

Commit

Permalink
Ensure that Rule.parser does not match JSON for requireEnsure: false …
Browse files Browse the repository at this point in the history
…setting
  • Loading branch information
sebinsua committed Mar 24, 2020
1 parent 33cf366 commit c6718fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ module.exports = function(webpackEnv) {
strictExportPresence: true,
rules: [
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },
// Webpack 5 Change: We had to add a type to continue to remove requireEnsure since otherwise it thinks the Rule.type is json.
// This might be a Webpack 5 bug.
// See https://github.com/smelukov/webpack.js.org/blob/ceba5c77f7964e7982a1b666905924d89e4a2d4c/src/content/configuration/module.mdx#ruleparserparse
// See https://github.com/webpack/webpack/pull/10054
{ type: 'javascript/auto', parser: { requireEnsure: false } },

// First, run the linter.
// It's important to do this before Babel processes the JS.
Expand Down

0 comments on commit c6718fe

Please sign in to comment.