Skip to content

Commit

Permalink
fix(webpack): use javascript/auto for js rule (#9180)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 17, 2021
1 parent db11f7b commit 7955553
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cli/test/unit/__snapshots__/webpack.test.js.snap
Expand Up @@ -62,6 +62,7 @@ exports[`webpack nuxt webpack module.rules 1`] = `
Object {
\\"exclude\\": [Function exclude],
\\"test\\": /\\\\.m?jsx?$/i,
\\"type\\": \\"javascript/auto\\",
\\"use\\": Array [
Object {
\\"loader\\": \\"<nuxtDir>/node_modules/babel-loader/lib/index.js\\",
Expand Down Expand Up @@ -674,6 +675,7 @@ exports[`webpack nuxt webpack module.rules test=.jsx 1`] = `
"Object {
\\"exclude\\": [Function exclude],
\\"test\\": /\\\\.m?jsx?$/i,
\\"type\\": \\"javascript/auto\\",
\\"use\\": Array [
Object {
\\"loader\\": \\"<nuxtDir>/node_modules/babel-loader/lib/index.js\\",
Expand Down
1 change: 1 addition & 0 deletions packages/webpack/src/config/base.js
Expand Up @@ -330,6 +330,7 @@ export default class WebpackBaseConfig {
},
{
test: /\.m?jsx?$/i,
type: 'javascript/auto',
exclude: (file) => {
file = file.split(/node_modules(.*)/)[1]

Expand Down

0 comments on commit 7955553

Please sign in to comment.