-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
36 lines (35 loc) · 1000 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
36
import commonJs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import scss from 'rollup-plugin-scss'
import copy from 'rollup-plugin-copy'
export default [{
input: [
'app/assets/javascripts/application.js'
],
output: {
dir: 'public/javascripts',
sourcemap: true
},
plugins: [
// Copy all assets other than scripts and styles to public folder
copy({
targets: [{
src: 'app/assets/!(javascripts|stylesheets)',
dest: 'public'
}]
}),
// Resolve modules imported from node_modules
nodeResolve(),
// Convert CommonJS modules to ES6
commonJs(),
// Concatenate govuk-frontend, application and component styles
scss({
includePaths: ['node_modules'],
output: 'public/stylesheets/application.css',
quietDeps: true,
sourceMap: true,
verbose: false,
watch: ['app/assets/stylesheets', 'node_modules/govuk-prototype-components/x-govuk']
})
]
}]