Skip to content

Commit eb74552

Browse files
committed
fix wor webpack5
1 parent 28c8341 commit eb74552

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,10 @@ module.exports = function (webpackEnv) {
457457
rules: [
458458
// Disable require.ensure as it's not a standard language feature.
459459
// Add support for magic comments in commonjs modules (i.e. webpackIgnore for dynamic imports)
460-
{ parser: { requireEnsure: false, commonjsMagicComments: true } },
460+
{
461+
test: /\.[cm]?(ts|tsx|js|jsx)$/,
462+
parser: { javascript: { requireEnsure: false, commonjsMagicComments: true }, },
463+
},
461464
// Handle node_modules packages that contain sourcemaps
462465
shouldUseSourceMap && {
463466
enforce: 'pre',

0 commit comments

Comments
 (0)