fix: disable node-externals for dev mode (#5414)

This commit is contained in:
Xin Du (Clark) 2019-03-31 21:35:06 +01:00 committed by Pooya Parsa
parent 159123feea
commit a5a165749a

View File

@ -29,12 +29,6 @@ export default class WebpackServerConfig extends WebpackBaseConfig {
} }
} }
// Bundle vue js for avoiding single shared Vue instance
const { runInNewContext } = this.buildContext.options.render.bundleRenderer
if (runInNewContext === true) {
whitelist.push('vue')
}
return whitelist return whitelist
} }
@ -94,7 +88,7 @@ export default class WebpackServerConfig extends WebpackBaseConfig {
// https://webpack.js.org/configuration/externals/#externals // https://webpack.js.org/configuration/externals/#externals
// https://github.com/liady/webpack-node-externals // https://github.com/liady/webpack-node-externals
// https://vue-loader.vuejs.org/migrating.html#ssr-externals // https://vue-loader.vuejs.org/migrating.html#ssr-externals
if (!this.buildContext.buildOptions.standalone) { if (!this.dev && !this.buildContext.buildOptions.standalone) {
this.buildContext.options.modulesDir.forEach((dir) => { this.buildContext.options.modulesDir.forEach((dir) => {
if (fs.existsSync(dir)) { if (fs.existsSync(dir)) {
config.externals.push( config.externals.push(