DUtils/rollup.config.js

20 lines
768 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { terser } from "rollup-plugin-terser";
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
export default {
input: './src/main.js', //rollup先执行的入口文件。
output: {
file: 'dutils.js', // 要写入的文件也可以用于生成的sourcemaps。
format: 'es', // rollup支持的多种输出格式(有amd,cjs, es, iife 和 umd)
name: 'Dutils', // 变量名,代表你的 `iife`/`umd` 包,同一页上的其他脚本可以访问它
sourcemap: false // 调试代码
},
plugins: [
resolve(),
commonjs(),
// terser() // 根据环境变量决定是否压缩(process.env.NODE_ENV === 'production' && terser())
]
}