-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
44 lines (43 loc) · 1.1 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
42
43
44
import resolve from 'rollup-plugin-node-resolve';
import { terser } from "rollup-plugin-terser";
import { injectManifest } from 'rollup-plugin-workbox';
import minifyHTML from 'rollup-plugin-minify-html-literals';
import strip from '@rollup/plugin-strip';
import copy from 'rollup-plugin-copy';
export default {
input: ['build/script/pages/app-index.js'],
output: {
dir: 'dist/script/',
format: 'es',
},
plugins: [
resolve(),
minifyHTML(),
terser(),
strip({
functions: ['console.log']
}),
copy({
targets: [
{ src: 'index.prod.html', dest: 'dist/', rename: 'index.html' },
{ src: 'assets/**/*', dest: 'dist/assets/' },
{ src: 'src/global.css', dest: 'dist/'},
{ src: 'manifest.json', dest: 'dist/'},
{ src: 'pwabuilder-sw.js', dest: 'dist/'}
]
}),
injectManifest({
swSrc: 'pwabuilder-sw.js',
swDest: 'dist/pwabuilder-sw.js',
globDirectory: 'dist/',
globPatterns: [
'*.css',
'**/*/*.svg',
'*/**.js',
'*.html',
'assets/**',
'*.json'
]
})
]
};