1 Star 0 Fork 0

/cn.vuejs.org

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
update.js 859 Bytes
一键复制 编辑 原始数据 按行查看 历史
尤雨溪 提交于 2016-11-05 09:58 . 2.0.5
var fs = require('fs')
var version = require('../vue/package.json').version
var themeconfPath = 'themes/vue/_config.yml'
var installPath = 'src/guide/installation.md'
var themeconfig = fs.readFileSync(themeconfPath, 'utf-8')
var installation = fs.readFileSync(installPath, 'utf-8')
fs.writeFileSync(
themeconfPath,
themeconfig.replace(/vue_version: .*/, 'vue_version: ' + version)
)
var sizes = {
dev: 'vue.js',
min: 'vue.min.js',
gz: 'vue.min.js.gz',
ro_gz: 'vue.common.min.js.gz'
}
for (var file in sizes) {
var filesize = fs.statSync('../vue/dist/' + sizes[file], 'utf-8').size
sizes[file] = (filesize / 1024).toFixed(2)
}
fs.writeFileSync(
installPath,
installation
.replace(/vue_version: .*/, 'vue_version: ' + version)
.replace(/(\w+)_size:.*/g, function (m, p1) {
return p1 + '_size: "' + sizes[p1] + '"'
})
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/joybuy/cn.vuejs.org.git
git@gitee.com:joybuy/cn.vuejs.org.git
joybuy
cn.vuejs.org
cn.vuejs.org
master

搜索帮助