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 => {
|
||||
// not exclude files outside node_modules
|
||||
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
|
||||
if (new RegExp(pkg).test(file)) {
|
||||
if (module.test(file)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,8 @@ export default class WebpackServerConfig extends BaseConfig {
|
||||
whitelist: [
|
||||
/es6-promise|\.(?!(?:js|json)$).{1,5}$/i,
|
||||
/\.css$/,
|
||||
/\?vue&type=style/
|
||||
/\?vue&type=style/,
|
||||
...this.options.build.transpile
|
||||
],
|
||||
modulesDir: dir
|
||||
})
|
||||
|
@ -192,7 +192,8 @@ Options.from = function (_options) {
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user