mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
feat: mock stream
This commit is contained in:
parent
bec1c8edfa
commit
040af4ea4e
@ -19,6 +19,7 @@ export const getRollupConfig = (config) => {
|
|||||||
'consola',
|
'consola',
|
||||||
// vue2
|
// vue2
|
||||||
'encoding',
|
'encoding',
|
||||||
|
'stream',
|
||||||
'he',
|
'he',
|
||||||
'resolve',
|
'resolve',
|
||||||
'source-map',
|
'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'),
|
entry: require.resolve('./entry'),
|
||||||
node: false,
|
node: false,
|
||||||
hooks: {
|
hooks: {
|
||||||
config (config) {
|
|
||||||
if (config.nuxt === 2) {
|
|
||||||
config.renderer = 'vue2.basic'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'rollup:before' ({ rollupConfig }) {
|
'rollup:before' ({ rollupConfig }) {
|
||||||
rollupConfig.output.intro =
|
rollupConfig.output.intro =
|
||||||
'const global = {}; const exports = {}; const module = { exports }; const process = { env: {}, hrtime: () => [0,0]};' +
|
'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' }
|
{ src: resolve(__dirname, 'index.html'), dst: '200.html' }
|
||||||
],
|
],
|
||||||
hooks: {
|
hooks: {
|
||||||
config (config) {
|
|
||||||
if (config.nuxt === 2) {
|
|
||||||
config.renderer = 'vue2.basic'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'rollup:before' ({ rollupConfig }) {
|
'rollup:before' ({ rollupConfig }) {
|
||||||
rollupConfig.output.intro =
|
rollupConfig.output.intro =
|
||||||
'const global = {}; const exports = {}; const module = { exports }; const process = { env: {}, hrtime: () => [0,0]};' +
|
'const global = {}; const exports = {}; const module = { exports }; const process = { env: {}, hrtime: () => [0,0]};' +
|
||||||
|
Loading…
Reference in New Issue
Block a user