Skip to content

Commit 1e8ca42

Browse files
iansuPavel Zhytko
authored and
Pavel Zhytko
committed
Add mjs and jsx filename extensions to file-loader exclude pattern (facebook#3537)
1 parent 291be6c commit 1e8ca42

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
@@ -225,7 +225,7 @@ module.exports = {
225225
// it's runtime that would otherwise processed through "file" loader.
226226
// Also exclude `html` and `json` extensions so they get processed
227227
// by webpacks internal loaders.
228-
exclude: [/\.js$/, /\.html$/, /\.json$/],
228+
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
229229
loader: require.resolve('file-loader'),
230230
options: {
231231
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
@@ -257,7 +257,7 @@ module.exports = {
257257
// it's runtime that would otherwise processed through "file" loader.
258258
// Also exclude `html` and `json` extensions so they get processed
259259
// by webpacks internal loaders.
260-
exclude: [/\.js$/, /\.html$/, /\.json$/],
260+
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
261261
options: {
262262
name: 'static/media/[name].[hash:8].[ext]',
263263
},

0 commit comments

Comments
 (0)