mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-22 16:39: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 {
|
Object {
|
||||||
\\"exclude\\": [Function exclude],
|
\\"exclude\\": [Function exclude],
|
||||||
\\"test\\": /\\\\.m?jsx?$/i,
|
\\"test\\": /\\\\.(c|m)?jsx?$/i,
|
||||||
\\"type\\": \\"javascript/auto\\",
|
\\"type\\": \\"javascript/auto\\",
|
||||||
\\"use\\": Array [
|
\\"use\\": Array [
|
||||||
Object {
|
Object {
|
||||||
@ -674,7 +674,7 @@ exports[`webpack nuxt webpack module.rules loader=vue- 1`] = `
|
|||||||
exports[`webpack nuxt webpack module.rules test=.jsx 1`] = `
|
exports[`webpack nuxt webpack module.rules test=.jsx 1`] = `
|
||||||
"Object {
|
"Object {
|
||||||
\\"exclude\\": [Function exclude],
|
\\"exclude\\": [Function exclude],
|
||||||
\\"test\\": /\\\\.m?jsx?$/i,
|
\\"test\\": /\\\\.(c|m)?jsx?$/i,
|
||||||
\\"type\\": \\"javascript/auto\\",
|
\\"type\\": \\"javascript/auto\\",
|
||||||
\\"use\\": Array [
|
\\"use\\": Array [
|
||||||
Object {
|
Object {
|
||||||
|
@ -239,7 +239,7 @@ export default class WebpackBaseConfig {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.wasm', '.mjs', '.js', '.json', '.vue', '.jsx'],
|
extensions: ['.wasm', '.mjs', '.cjs', '.js', '.json', '.vue', '.jsx'],
|
||||||
alias: this.alias(),
|
alias: this.alias(),
|
||||||
modules: webpackModulesDir,
|
modules: webpackModulesDir,
|
||||||
plugins: resolvePlugins
|
plugins: resolvePlugins
|
||||||
@ -329,7 +329,7 @@ export default class WebpackBaseConfig {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.m?jsx?$/i,
|
test: /\.(c|m)?jsx?$/i,
|
||||||
type: 'javascript/auto',
|
type: 'javascript/auto',
|
||||||
exclude: (file) => {
|
exclude: (file) => {
|
||||||
file = file.split(/node_modules(.*)/)[1]
|
file = file.split(/node_modules(.*)/)[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user