Skip to content

Commit a70eff9

Browse files
authored
fix webpack config interpreting cjs files as assets (#111)
Co-authored-by: Jason Crow <[email protected]>
1 parent 266038e commit a70eff9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,9 @@ module.exports = function (webpackEnv) {
707707
// its runtime that would otherwise be processed through "file" loader.
708708
// Also exclude `html` and `json` extensions so they get processed
709709
// by webpacks internal loaders.
710-
exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
710+
711+
// note: 10/16/23 update to also exclude cjs files as packages such as axios may be configured to prefer these for the browser
712+
exclude: [/^$/, /\.(js|mjs|jsx|cjs|ts|tsx)$/, /\.html$/, /\.json$/],
711713
type: 'asset/resource',
712714
},
713715
// ** STOP ** Are you adding a new loader?

packages/react-scripts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bentley/react-scripts",
3-
"version": "5.0.6",
3+
"version": "5.0.7",
44
"description": "iTwin.js configuration and scripts for Create React App.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)