1 Star 1 Fork 2

XM/alioss-web-uploader

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
XM 提交于 2019-11-13 16:25 . :wrench:Update rollup config
import resolve from 'rollup-plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import commonjs from "rollup-plugin-commonjs";
import babel from 'rollup-plugin-babel';
import filesize from 'rollup-plugin-filesize';
// import analyze from 'rollup-plugin-analyzer'
// import { uglify } from 'rollup-plugin-uglify'
import {terser} from 'rollup-plugin-terser'
import pkg from './package.json';
// const env = process.env.NODE_ENV;
const noDeclarationFiles = {compilerOptions: {declaration: false}};
const name = 'AliOSSWebUploader';
const config = [
// CommonJS
{
input: 'src/index.ts',
output: {
file: pkg.module,
format: 'cjs',
indent: false,
},
plugins: [
resolve(),
commonjs(),
typescript({useTsconfigDeclarationDir: true}),
babel(),
]
},
// ES
{
input: 'src/index.ts',
output: {
file: pkg.es2015,
format: 'es',
indent: false,
},
plugins: [
resolve(),
commonjs(),
typescript({tsconfigOverride: noDeclarationFiles}),
babel(),
]
},
// UMD production
{
input: 'src/index.ts',
output: {
file: pkg.main.replace(/.js$/, '.min.js'),
format: 'umd',
name,
indent: false,
sourcemap: true,
},
plugins: [
resolve(),
commonjs(),
typescript({tsconfigOverride: noDeclarationFiles}),
babel({
exclude: 'node_modules/**'
}),
// uglify(),
terser({
compress: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
warnings: false,
},
output: {
comments: false,
},
}),
filesize(),
]
},
// UMD development
{
input: 'src/index.ts',
output: {
file: pkg.main,
format: 'umd',
name,
sourcemap: true,
// footer: '/* @see https://github.com */',
},
plugins: [
resolve(),
commonjs(),
typescript({tsconfigOverride: noDeclarationFiles}),
filesize(),
babel({
exclude: 'node_modules/**'
}),
]
},
];
export default config;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/zhang0ZGC/alioss-web-uploader.git
[email protected]:zhang0ZGC/alioss-web-uploader.git
zhang0ZGC
alioss-web-uploader
alioss-web-uploader
master

搜索帮助