-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrollup.config.js
More file actions
51 lines (45 loc) · 1.08 KB
/
rollup.config.js
File metadata and controls
51 lines (45 loc) · 1.08 KB
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
import { babel } from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import terser from '@rollup/plugin-terser'
/**
* Rollup config
*
* @type {RollupOptions}
*/
export default {
input: 'manage_breast_screening/assets/js/index.js',
output: {
compact: true,
format: 'es',
file: 'manage_breast_screening/assets/compiled/js/main.min.js',
plugins: [
// Minification using terser
terser({
// Allow Terser to remove @preserve comments
format: { comments: false },
mangle: {
keep_classnames: true,
keep_fnames: true
},
// Include sources content from source maps to inspect
// NHS.UK frontend and other dependencies' source code
sourceMap: {
includeSources: true
},
// Compatibility workarounds
safari10: true
})
]
},
plugins: [
nodeResolve(),
commonjs(),
babel({
babelHelpers: 'bundled'
})
]
}
/**
* @import { RollupOptions } from 'rollup'
*/