workaround for es6-promise and vue-server-renderer

This commit is contained in:
Pooya Parsa 2017-08-10 16:16:00 +04:30
parent d7cb08b746
commit 127155d61a
2 changed files with 6 additions and 6 deletions

View File

@ -52,14 +52,15 @@ export default function webpackServerConfig () {
// https://webpack.js.org/configuration/externals/#externals
// https://github.com/liady/webpack-node-externals
const moduleDirs = [
this.options.modulesDir,
resolve(__dirname, '..', 'node_modules')
this.options.modulesDir
// Temporary disabled due to vue-server-renderer module search limitations
// resolve(__dirname, '..', 'node_modules')
]
moduleDirs.forEach(dir => {
if (existsSync(dir)) {
config.externals.push(nodeExternals({
// load non-javascript files with extensions, presumably via loaders
whitelist: [/\.(?!(?:js|json)$).{1,5}$/i],
whitelist: [/es6-promise|\.(?!(?:js|json)$).{1,5}$/i],
modulesDir: dir
}))
}

View File

@ -132,9 +132,8 @@ export default class Renderer extends Tapable {
// Create bundle renderer for SSR
this.bundleRenderer = createBundleRenderer(this.resources.serverBundle, Object.assign({
clientManifest: this.resources.clientManifest,
runInNewContext: false
// Explicitly setting basedir makes problems with linked nuxt and npx
// basedir: this.options.rootDir
runInNewContext: false,
basedir: this.options.rootDir
}, this.options.render.bundleRenderer))
// Promisify renderToString