mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +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://webpack.js.org/configuration/externals/#externals
|
||||||
// https://github.com/liady/webpack-node-externals
|
// https://github.com/liady/webpack-node-externals
|
||||||
const moduleDirs = [
|
const moduleDirs = [
|
||||||
this.options.modulesDir,
|
this.options.modulesDir
|
||||||
resolve(__dirname, '..', 'node_modules')
|
// Temporary disabled due to vue-server-renderer module search limitations
|
||||||
|
// resolve(__dirname, '..', 'node_modules')
|
||||||
]
|
]
|
||||||
moduleDirs.forEach(dir => {
|
moduleDirs.forEach(dir => {
|
||||||
if (existsSync(dir)) {
|
if (existsSync(dir)) {
|
||||||
config.externals.push(nodeExternals({
|
config.externals.push(nodeExternals({
|
||||||
// load non-javascript files with extensions, presumably via loaders
|
// 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
|
modulesDir: dir
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
@ -132,9 +132,8 @@ export default class Renderer extends Tapable {
|
|||||||
// Create bundle renderer for SSR
|
// Create bundle renderer for SSR
|
||||||
this.bundleRenderer = createBundleRenderer(this.resources.serverBundle, Object.assign({
|
this.bundleRenderer = createBundleRenderer(this.resources.serverBundle, Object.assign({
|
||||||
clientManifest: this.resources.clientManifest,
|
clientManifest: this.resources.clientManifest,
|
||||||
runInNewContext: false
|
runInNewContext: false,
|
||||||
// Explicitly setting basedir makes problems with linked nuxt and npx
|
basedir: this.options.rootDir
|
||||||
// basedir: this.options.rootDir
|
|
||||||
}, this.options.render.bundleRenderer))
|
}, this.options.render.bundleRenderer))
|
||||||
|
|
||||||
// Promisify renderToString
|
// Promisify renderToString
|
||||||
|
Loading…
Reference in New Issue
Block a user