代码拉取完成,页面将自动刷新
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;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。