-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
35 lines (34 loc) · 945 Bytes
/
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
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
export default {
input: './lib/svgo.js',
output: {
file: './dist/svgo.browser.js',
format: 'esm',
},
onwarn(warning) {
throw Error(warning.toString());
},
plugins: [
{
resolveId(importee, importer) {
// see https://github.com/csstree/csstree/pull/152
if (importee === 'css-tree') {
return this.resolve('css-tree/dist/csstree.min.js', importer);
}
},
},
nodeResolve({ browser: true, preferBuiltins: false }),
commonjs(),
json(),
// Whitespaces and comments removal makes the browser bundle lighter
// while retaining the ability to debug errors
terser({
compress: false,
mangle: false,
format: { comments: false },
}),
],
};