-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrollup.config.js
49 lines (48 loc) · 1.24 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
42
43
44
45
46
47
48
49
import babel from 'rollup-plugin-babel';
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import commonjs from '@rollup/plugin-commonjs';
import { eslint } from 'rollup-plugin-eslint';
import cleanup from 'rollup-plugin-cleanup';
export default {
input: './src/index.js',
output: [
{ file: 'dist/vue-keep.cjs.js' },
{ file: 'dist/vue-keep.cjs.min.js', plugins: [terser()] },
{ file: 'dist/vue-keep.esm.js', format: 'esm' },
{ file: 'dist/vue-keep.global.js', format: 'iife', name: 'keep' }
],
plugins: [
eslint({}),
babel({
exclude: 'node_modules/**', // 排除node_modules所有文件
runtimeHelpers: true,
// 使用预设
presets: [
[
'@babel/preset-env', {
modules: false,
// 目标浏览器
targets: {
edge: 17,
firefox: 60,
chrome: 67,
safari: 11.1,
ie: 9
}
}
]
],
'plugins': [
['@babel/plugin-transform-runtime', {
regenerator: true,
absoluteRuntime: true,
useESModules: false,
}]
]
}),
resolve(),
commonjs(),
cleanup()
],
};