mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 15:10:58 +00:00
fix(webpack): allow files with .cjs
extension to be transpiled (#10340)
[release]
This commit is contained in:
parent
e5efc25940
commit
7a25294c5f
@ -61,7 +61,7 @@ exports[`webpack nuxt webpack module.rules 1`] = `
|
||||
},
|
||||
Object {
|
||||
\\"exclude\\": [Function exclude],
|
||||
\\"test\\": /\\\\.m?jsx?$/i,
|
||||
\\"test\\": /\\\\.(c|m)?jsx?$/i,
|
||||
\\"type\\": \\"javascript/auto\\",
|
||||
\\"use\\": Array [
|
||||
Object {
|
||||
@ -674,7 +674,7 @@ exports[`webpack nuxt webpack module.rules loader=vue- 1`] = `
|
||||
exports[`webpack nuxt webpack module.rules test=.jsx 1`] = `
|
||||
"Object {
|
||||
\\"exclude\\": [Function exclude],
|
||||
\\"test\\": /\\\\.m?jsx?$/i,
|
||||
\\"test\\": /\\\\.(c|m)?jsx?$/i,
|
||||
\\"type\\": \\"javascript/auto\\",
|
||||
\\"use\\": Array [
|
||||
Object {
|
||||
|
@ -239,7 +239,7 @@ export default class WebpackBaseConfig {
|
||||
|
||||
return {
|
||||
resolve: {
|
||||
extensions: ['.wasm', '.mjs', '.js', '.json', '.vue', '.jsx'],
|
||||
extensions: ['.wasm', '.mjs', '.cjs', '.js', '.json', '.vue', '.jsx'],
|
||||
alias: this.alias(),
|
||||
modules: webpackModulesDir,
|
||||
plugins: resolvePlugins
|
||||
@ -329,7 +329,7 @@ export default class WebpackBaseConfig {
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.m?jsx?$/i,
|
||||
test: /\.(c|m)?jsx?$/i,
|
||||
type: 'javascript/auto',
|
||||
exclude: (file) => {
|
||||
file = file.split(/node_modules(.*)/)[1]
|
||||
|
Loading…
Reference in New Issue
Block a user