mirror of
https://github.com/vuejs/vue.git
synced 2024-11-22 04:39:46 +00:00
20 lines
594 B
JavaScript
20 lines
594 B
JavaScript
'use strict'
|
|
|
|
process.env.NODE_ENV = 'production'
|
|
|
|
const Vue = require('../../dist/vue.runtime.common.js')
|
|
const createRenderer = require('../../packages/server-renderer').createRenderer
|
|
const renderToString = createRenderer().renderToString
|
|
const gridComponent = require('./common.js')
|
|
|
|
console.log('--- renderToString --- ')
|
|
const self = (global || root)
|
|
self.s = self.performance.now()
|
|
|
|
renderToString(new Vue(gridComponent), (err, res) => {
|
|
if (err) throw err
|
|
// console.log(res)
|
|
console.log('Complete time: ' + (self.performance.now() - self.s).toFixed(2) + 'ms')
|
|
console.log()
|
|
})
|