mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
feat: exclude build.transpile in server node externals (#3614)
This commit is contained in:
parent
8c54c6d577
commit
56db988f27
@ -142,9 +142,9 @@ export default class WebpackBaseConfig {
|
|||||||
exclude: file => {
|
exclude: file => {
|
||||||
// not exclude files outside node_modules
|
// not exclude files outside node_modules
|
||||||
if (/node_modules/.test(file)) {
|
if (/node_modules/.test(file)) {
|
||||||
for (let pkg of this.options.build.transpile) {
|
for (let module of [/\.vue\.js/].concat(this.options.build.transpile)) {
|
||||||
// item in transpile can be string or regex object
|
// item in transpile can be string or regex object
|
||||||
if (new RegExp(pkg).test(file)) {
|
if (module.test(file)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,8 @@ export default class WebpackServerConfig extends BaseConfig {
|
|||||||
whitelist: [
|
whitelist: [
|
||||||
/es6-promise|\.(?!(?:js|json)$).{1,5}$/i,
|
/es6-promise|\.(?!(?:js|json)$).{1,5}$/i,
|
||||||
/\.css$/,
|
/\.css$/,
|
||||||
/\?vue&type=style/
|
/\?vue&type=style/,
|
||||||
|
...this.options.build.transpile
|
||||||
],
|
],
|
||||||
modulesDir: dir
|
modulesDir: dir
|
||||||
})
|
})
|
||||||
|
@ -192,7 +192,8 @@ Options.from = function (_options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// include SFCs in node_modules
|
// include SFCs in node_modules
|
||||||
options.build.transpile = [/\.vue\.js/].concat(options.build.transpile || [])
|
options.build.transpile = [].concat(options.build.transpile || [])
|
||||||
|
.map(module => module instanceof RegExp ? module : new RegExp(module))
|
||||||
|
|
||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user