mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
workaround for es6-promise and vue-server-renderer
This commit is contained in:
parent
d7cb08b746
commit
127155d61a
@ -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
|
||||
}))
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user