Skip to content

Commit

Permalink
fix webpack config interpreting cjs files as assets (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Crow <25822334+jason-crow@users.noreply.github.com>
  • Loading branch information
jason-crow and jason-crow authored Nov 16, 2023
1 parent 266038e commit a70eff9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,9 @@ 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$/],

// note: 10/16/23 update to also exclude cjs files as packages such as axios may be configured to prefer these for the browser
exclude: [/^$/, /\.(js|mjs|jsx|cjs|ts|tsx)$/, /\.html$/, /\.json$/],
type: 'asset/resource',
},
// ** STOP ** Are you adding a new loader?
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bentley/react-scripts",
"version": "5.0.6",
"version": "5.0.7",
"description": "iTwin.js configuration and scripts for Create React App.",
"repository": {
"type": "git",
Expand Down

0 comments on commit a70eff9

Please sign in to comment.