-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrollup.config.js
59 lines (53 loc) · 1.09 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
50
51
52
53
54
55
56
57
58
59
import commonjs from 'rollup-plugin-commonjs';
import filesize from "rollup-plugin-filesize";
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
const libName = 'sqsptemplate2';
const isProd = process.env.NODE_ENV == 'production';
const plugins = [
json({
jsnext: true,
compact: true,
preferConst: true,
namedExports: true
}),
resolve({
mainFields: ['module'],
extension: ['.js', '.json']
}),
commonjs({
extensions: ['.json', '.js'],
}),
];
if (isProd) {
plugins.push(terser({
output: {
ecma: 5
}
}));
}
plugins.push(filesize({
showBrotliSize: true
}));
const tasks = [
{
input: 'lib-es/index.js',
output: {
name: libName,
file: `dist/${libName}.umd.js`,
format: 'umd',
exports: 'named',
sourcemap: true,
},
plugins,
external: [
'@phensley/cldr-core',
'@phensley/cldr-schema',
'@phensley/cldr-utils',
'@phensley/decimal',
'@phensley/timezone'
]
},
];
export default tasks;