mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
feat: mock stream
This commit is contained in:
parent
bec1c8edfa
commit
040af4ea4e
@ -19,6 +19,7 @@ export const getRollupConfig = (config) => {
|
||||
'consola',
|
||||
// vue2
|
||||
'encoding',
|
||||
'stream',
|
||||
'he',
|
||||
'resolve',
|
||||
'source-map',
|
||||
|
@ -22,4 +22,4 @@ function getProxy (name) {
|
||||
})
|
||||
}
|
||||
|
||||
export default getProxy('mock')
|
||||
module.exports = getProxy('mock')
|
@ -1,13 +0,0 @@
|
||||
|
||||
import _renderToString from 'vue-server-renderer/basic.js'
|
||||
|
||||
export function renderToString (component, context) {
|
||||
return new Promise((resolve, reject) => {
|
||||
_renderToString(component, context, (err, result) => {
|
||||
if (err) {
|
||||
return reject(err)
|
||||
}
|
||||
return resolve(result)
|
||||
})
|
||||
})
|
||||
}
|
@ -2,11 +2,6 @@ export default {
|
||||
entry: require.resolve('./entry'),
|
||||
node: false,
|
||||
hooks: {
|
||||
config (config) {
|
||||
if (config.nuxt === 2) {
|
||||
config.renderer = 'vue2.basic'
|
||||
}
|
||||
},
|
||||
'rollup:before' ({ rollupConfig }) {
|
||||
rollupConfig.output.intro =
|
||||
'const global = {}; const exports = {}; const module = { exports }; const process = { env: {}, hrtime: () => [0,0]};' +
|
||||
|
@ -11,11 +11,6 @@ export default {
|
||||
{ src: resolve(__dirname, 'index.html'), dst: '200.html' }
|
||||
],
|
||||
hooks: {
|
||||
config (config) {
|
||||
if (config.nuxt === 2) {
|
||||
config.renderer = 'vue2.basic'
|
||||
}
|
||||
},
|
||||
'rollup:before' ({ rollupConfig }) {
|
||||
rollupConfig.output.intro =
|
||||
'const global = {}; const exports = {}; const module = { exports }; const process = { env: {}, hrtime: () => [0,0]};' +
|
||||
|
Loading…
Reference in New Issue
Block a user