-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
41 lines (39 loc) · 1.03 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import { uglify } from 'rollup-plugin-uglify'
import banner from 'rollup-plugin-banner'
const pkg = require('./package.json')
export default {
input: 'src/index.ts',
output: [
{
// dir 构建目录,多文件构建
// dir: 'dist',
// file 构建文件名,单文件构建。dir 和 file 只能二选一
file: 'dist/motion.umd.js',
format: 'umd',
name: 'Motion',
plugins: [
uglify({
mangle: true
})
]
},
{
// dir: 'dist',
file: 'dist/motion.esm.js',
format: 'es'
}
],
plugins: [
nodeResolve(),
commonjs(),
typescript({
// 可覆盖 tsconfig.json 文件中的 CompilerOptions 配置
// https://github.com/rollup/plugins/tree/master/packages/typescript/#readme
sourceMap: false
}),
banner(`${pkg.name}\nv${pkg.version}\nby ${pkg.author}`)
]
}