docsify/build/build-ssr.js

34 lines
729 B
JavaScript
Raw Normal View History

2017-05-29 22:24:38 +08:00
var rollup = require('rollup')
2017-05-30 13:58:05 +08:00
var buble = require('rollup-plugin-buble')
var async = require('rollup-plugin-async')
2017-05-31 08:25:00 +08:00
var replace = require('rollup-plugin-replace')
2017-05-29 22:24:38 +08:00
rollup
.rollup({
entry: 'packages/docsify-server-renderer/index.js',
plugins: [
2017-05-30 13:58:05 +08:00
async(),
2017-05-31 08:25:00 +08:00
replace({
__VERSION__: process.env.VERSION || require('../package.json').version
}),
2017-05-30 13:58:05 +08:00
buble({
transforms: {
generator: false
}
2017-05-30 13:13:41 +08:00
})
2017-05-29 22:24:38 +08:00
],
2017-09-22 10:07:10 +08:00
onwarn: function () {}
2017-05-29 22:24:38 +08:00
})
.then(function (bundle) {
var dest = 'packages/docsify-server-renderer/build.js'
console.log(dest)
bundle.write({
format: 'cjs',
dest: dest
})
})
.catch(function (err) {
console.error(err)
})