内容简介:参考资料:1、
rollup -w -c scripts/config.js --environment TARGET:web-full-dev
-c
指定配置文件
-w
监听文件,文件发生改变时重新构建
--environment
设置环境变量。如 rollup -c --environment TARGET:web-full-dev
可以通过 process.env.TARGET
获取
if (process.env.TARGET) { // 根据TARGET生成rollup config对象 module.exports = genConfig(process.env.TARGET) //生成rollup config对象 } else { //如果没有设置TARGET,返回生成函数 exports.getBuild = genConfig exports.getAllBuilds = () => Object.keys(builds).map(genConfig) }
rollup -w -c scripts/config.js --environment TARGET:web-full-dev
对应rollup config对象如下:
{ input: opts.entry, //入口 src/platforms/web/entry-runtime-with-compiler.js external: opts.external, plugins: [ flow(), alias(Object.assign({}, aliases, { he: './entity-decoder' })) ].concat(opts.plugins || []), output: { file: resolve('dist/vue.js'), format: 'umd', // umd – 通用模块定义,以amd,cjs 和 iife 为一体 banner: opts.banner, name: opts.moduleName || 'Vue' }, onwarn: (msg, warn) => { //拦截警告信息 if (!/Circular/.test(msg)) { warn(msg) } } }
- rollup-plugin-flow-no-whitespace //去除flow静态类型检查代码
- rollup-plugin-alias //为模块提供别名
- rollup-plugin-buble //编译ES6+语法为ES2015,无需配置,比babel更轻量
- rollup-plugin-replace //替换代码中的变量为指定值
参考资料:
1、 rollup文档
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Paradigms of Artificial Intelligence Programming
Peter Norvig / Morgan Kaufmann / 1991-10-01 / USD 77.95
Paradigms of AI Programming is the first text to teach advanced Common Lisp techniques in the context of building major AI systems. By reconstructing authentic, complex AI programs using state-of-the-......一起来看看 《Paradigms of Artificial Intelligence Programming》 这本书的介绍吧!