From 16b9c157bf5f37dc3bab4198c4cbfafe0b8add81 Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Sun, 5 Apr 2020 14:41:21 +0100 Subject: [PATCH] feat(webpack): add mjs to babel-loader (#7178) --- packages/cli/test/unit/__snapshots__/webpack.test.js.snap | 4 ++-- packages/webpack/src/config/base.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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]