-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
41 lines (40 loc) · 1.27 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
// Import rollup plugins
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import css from 'rollup-plugin-import-css';
import del from 'rollup-plugin-delete';
import copy from 'rollup-plugin-copy';
export default {
plugins: [
// Resolve bare module specifiers to relative paths
resolve(),
terser({
ecma: 2020,
module: true,
warnings: true,
}),
// Get any CSS in JS imports
css(),
// Remove old dist directory
del({
targets: './_site/assets/javascript',
}),
copy({ targets:
[
{ src: 'node_modules/@patternfly/icons/fas/*', dest: './_site/assets/javascript/icons/fas' },
{ src: 'node_modules/@patternfly/icons/far/*', dest: './_site/assets/javascript/icons/far' },
{ src: 'node_modules/@patternfly/icons/fab/*', dest: './_site/assets/javascript/icons/fab' },
{ src: 'node_modules/@patternfly/icons/patternfly/*', dest: './_site/assets/javascript/icons/patternfly' }
]
}),
],
// Single bundle example
input: 'public/assets/javascript/main.js',
output: [{
dir: 'public/assets/javascript/',
entryFileNames: 'bundle.js',
chunkFileNames: 'bundle-chunk.js',
format: 'esm'
}],
preserveEntrySignatures: 'strict',
};