1 Star 0 Fork 0

xgene/demuxer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
gemxx 提交于 2020-05-25 16:10 . chore: 🤖 change compiler to rollup
import path from 'path';
import livereloadPlugin from 'rollup-plugin-livereload';
import typescriptPlugin from 'rollup-plugin-typescript2';
import typescript from 'typescript';
const { BUILD_MODE } = process.env;
const getPlugins = function () {
const plugins = [
typescriptPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
typescript
})
];
if (BUILD_MODE === 'dev') {
plugins.push(livereloadPlugin());
}
return plugins;
};
let configs = [];
let formatMaps = [
{
entry: 'index',
outputName: 'all'
},
{
entry: 'ts-only',
outputName: 'ts'
},
{
entry: 'mp4-only',
outputName: 'mp4'
},
{
entry: 'flv-only',
outputName: 'flv'
}
];
formatMaps.forEach((item, index) => {
configs.push({
input: [`./src/${item.entry}.ts`],
output: [
{
file: `dist/demuxer.${item.outputName}.umd.js`,
format: 'umd',
name: 'Demuxer'
},
{
file: `dist/demuxer.${item.outputName}.esm.js`,
format: 'esm'
},
{
file: `dist/demuxer.${item.outputName}.cjs.js`,
format: 'cjs'
}
],
plugins: getPlugins()
});
});
export default configs;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xgene/demuxer.git
git@gitee.com:xgene/demuxer.git
xgene
demuxer
demuxer
master

搜索帮助