Skip to content

Commit

Permalink
fix: exclude CJS files with file loader (#11889)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdethier committed May 2, 2022
1 parent f99167c commit 814dc64
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,12 @@ module.exports = function (webpackEnv) {
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
exclude: [
/^$/,
/\.(js|mjs|jsx|ts|tsx|cjs)$/,
/\.html$/,
/\.json$/,
],
type: 'asset/resource',
},
// ** STOP ** Are you adding a new loader?
Expand Down

0 comments on commit 814dc64

Please sign in to comment.