Skip to content

Commit af291f3

Browse files
iansuTimer
authored andcommitted
Add mjs and jsx filename extensions to file-loader exclude pattern (#3537)
1 parent 9af0422 commit af291f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ module.exports = {
223223
// it's runtime that would otherwise processed through "file" loader.
224224
// Also exclude `html` and `json` extensions so they get processed
225225
// by webpacks internal loaders.
226-
exclude: [/\.js$/, /\.html$/, /\.json$/],
226+
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
227227
loader: require.resolve('file-loader'),
228228
options: {
229229
name: 'static/media/[name].[hash:8].[ext]',

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ module.exports = {
249249
// it's runtime that would otherwise processed through "file" loader.
250250
// Also exclude `html` and `json` extensions so they get processed
251251
// by webpacks internal loaders.
252-
exclude: [/\.js$/, /\.html$/, /\.json$/],
252+
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
253253
options: {
254254
name: 'static/media/[name].[hash:8].[ext]',
255255
},

0 commit comments

Comments
 (0)