-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrollup.config.js
More file actions
36 lines (34 loc) · 790 Bytes
/
rollup.config.js
File metadata and controls
36 lines (34 loc) · 790 Bytes
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
import path from 'path';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
function makeBundleTarget(src, target) {
return {
input: src,
plugins: [
nodeResolve({
moduleDirectories: ['node_modules', 'packages'],
}),
terser({
keep_classnames: true,
keep_fnames: true,
compress: {
keep_infinity: true,
}
})
],
// treeshake: true,
output: [{
inlineDynamicImports: true,
format: 'es',
file: target,
indent: ' '
}],
onwarn: (warning, warn) => {
if (warning.code === 'THIS_IS_UNDEFINED') return;
warn(warning);
}
};
}
export default [
makeBundleTarget('build/index.js', 'bundle/index.js'),
];