-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
50 lines (44 loc) · 1.11 KB
/
rollup.config.js
File metadata and controls
50 lines (44 loc) · 1.11 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
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: 'lung_cancer_screening/assets/js/index.js',
output: {
compact: true,
format: 'es',
file: 'lung_cancer_screening/assets/compiled/js/bundle.js',
sourcemap: true,
plugins: [
// Minification using terser
terser({
// Allow Terser to remove @preserve comments
format: { comments: false },
// Include sources content from source maps to inspect
// NHS.UK frontend and other dependencies' source code
sourceMap: {
includeSources: true
},
// Compatibility workarounds
safari10: true
})
]
},
plugins: [
// NHS.UK frontend uses commonjs, so we need to resolve and convert to ES modules
nodeResolve({
browser: true
}),
commonjs({
requireReturnsDefault: 'preferred',
defaultIsModuleExports: true
}),
]
}
/**
* @import { RollupOptions } from 'rollup'
*/