feat: mock stream

This commit is contained in:
Pooya Parsa 2020-11-04 03:06:23 +01:00
parent bec1c8edfa
commit 040af4ea4e
5 changed files with 2 additions and 24 deletions

View File

@ -19,6 +19,7 @@ export const getRollupConfig = (config) => {
'consola',
// vue2
'encoding',
'stream',
'he',
'resolve',
'source-map',

View File

@ -22,4 +22,4 @@ function getProxy (name) {
})
}
export default getProxy('mock')
module.exports = getProxy('mock')

View File

@ -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)
})
})
}

View File

@ -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]};' +

View File

@ -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]};' +