diff --git a/packages/cli/test/unit/__snapshots__/webpack.test.js.snap b/packages/cli/test/unit/__snapshots__/webpack.test.js.snap index 9017380c9f..b5000549cd 100644 --- a/packages/cli/test/unit/__snapshots__/webpack.test.js.snap +++ b/packages/cli/test/unit/__snapshots__/webpack.test.js.snap @@ -61,7 +61,7 @@ exports[`webpack nuxt webpack module.rules 1`] = ` }, Object { \\"exclude\\": [Function exclude], - \\"test\\": /\\\\.jsx?$/i, + \\"test\\": /\\\\.m?jsx?$/i, \\"use\\": Array [ Object { \\"loader\\": \\"/node_modules/babel-loader/lib/index.js\\", @@ -636,7 +636,7 @@ exports[`webpack nuxt webpack module.rules loader=vue- 1`] = ` exports[`webpack nuxt webpack module.rules test=.jsx 1`] = ` "Object { \\"exclude\\": [Function exclude], - \\"test\\": /\\\\.jsx?$/i, + \\"test\\": /\\\\.m?jsx?$/i, \\"use\\": Array [ Object { \\"loader\\": \\"/node_modules/babel-loader/lib/index.js\\", diff --git a/packages/webpack/src/config/base.js b/packages/webpack/src/config/base.js index 52a8862db1..f494cb3a6b 100644 --- a/packages/webpack/src/config/base.js +++ b/packages/webpack/src/config/base.js @@ -271,7 +271,7 @@ export default class WebpackBaseConfig { ] }, { - test: /\.jsx?$/i, + test: /\.m?jsx?$/i, exclude: (file) => { file = file.split('node_modules', 2)[1]