7 Star 13 Fork 0

Gitee 极速下载/anime

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/juliangarnier/anime
克隆/下载
build.js 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
Julian Garnier 提交于 2018-07-24 14:40 . Update build console log
const fs = require('fs');
const { rollup } = require('rollup');
const { minify } = require('uglify-js');
const pretty = require('pretty-bytes');
const sizer = require('gzip-size');
const pkg = require('./package');
const umd = pkg['umd:main'];
const date = new Date();
const banner = `/*
* anime.js v${ pkg.version }
* (c) ${ date.getFullYear() } Julian Garnier
* Released under the MIT license
* animejs.com
*/
`;
console.info('Compiling... 😤');
rollup({
input: 'src/index.js',
plugins: [
require('rollup-plugin-buble')({
transforms: {
modules: false,
dangerousForOf: true
},
targets: {
firefox: 32,
chrome: 24,
safari: 6,
opera: 15,
edge: 10,
ie: 10
}
})
]
}).then(bun => {
bun.write({
banner,
format: 'cjs',
file: pkg.main
});
bun.write({
banner,
format: 'es',
file: pkg.module
});
bun.write({
banner,
file: umd,
format: 'umd',
name: pkg['umd:name']
}).then(_ => {
const data = fs.readFileSync(umd, 'utf8');
// produce minified output
const { code } = minify(data);
fs.writeFileSync(umd, `${banner}\n${code}`); // with banner
// output gzip size
const int = sizer.sync(code);
console.info('Compilation was a success! 👍');
console.info(`~> gzip size: ${ pretty(int) }`);
}).catch(console.error);
}).catch(console.error);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/anime.git
git@gitee.com:mirrors/anime.git
mirrors
anime
anime
master

搜索帮助