-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
47 lines (45 loc) · 1.08 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
import {terser} from 'rollup-plugin-terser';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import postcss from 'rollup-plugin-postcss';
import postcssPresetEnv from 'postcss-preset-env/index.js';
process.chdir(__dirname);
module.exports = {
input: './index.js',
output: {
file: './js/dist/form.min.js',
name: 'Form',
format: 'umd'
},
plugins: [
postcss(
{
extract: true,
minimize: true,
plugins: [
postcssPresetEnv({browsers: ['defaults', 'not ie > 0']}),
],
}),
resolve({browser: true, preferBuiltins: false}),
commonjs(),
terser(),
babel(
{
babelHelpers: 'bundled',
babelrc: false,
exclude: [/\/core-js\//],
presets: [
[
'@babel/preset-env',
{
corejs: 3,
modules: false,
useBuiltIns: 'usage',
targets: ['defaults', 'not ie > 0'],
},
],
],
}),
]
};