-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup-prod.config.js
67 lines (61 loc) · 1.86 KB
/
rollup-prod.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import defaultConfig from './rollup.config.js';
import copy from 'rollup-plugin-copy';
import del from 'rollup-plugin-delete';
import license from 'rollup-plugin-license';
import terser from '@rollup/plugin-terser';
import path from 'path';
import { generateSW } from 'rollup-plugin-workbox';
import { workboxConfig } from './workbox-config.js';
// Files to remove before doing new src
const deleteConfig = {
targets: ['src/*']
};
// Extract license comments in separate file LICENSE.txt
const licenseConfig = {
thirdParty: {
output: path.join(__dirname, 'src', 'LICENSE.txt'),
includePrivate: true
}
};
// Used for minify JS
const terserConfig = {
format: {
comments: false
}
};
// Extra files to copy in src directory ./src
const copyConfig = {
targets: [
{ src: 'manifest.json', dest: 'src' },
{ src: 'version.json', dest: 'src' },
{ src: 'node_modules/leaflet/dist/', dest: 'src/node_modules/leaflet/' },
{ src: 'node_modules/esri-leaflet/dist/esri-leaflet.js', dest: 'src/node_modules/esri-leaflet/dist' },
{
src: 'node_modules/@mapbox/leaflet-omnivore/leaflet-omnivore.min.js',
dest: 'src/node_modules/@mapbox/leaflet-omnivore/'
},
{
src: 'node_modules/leaflet.markercluster/dist/leaflet.markercluster.js',
dest: 'src/node_modules/leaflet.markercluster/dist'
},
{
src: 'src_ts/components/pages/interventions/pages/intervention-tab-pages/assets/i18n',
dest: 'src/src/components/pages/interventions/pages/intervention-tab-pages/assets'
},
{ src: 'assets', dest: 'src' },
{ src: 'index.html', dest: 'src' }
]
};
const config = {
...defaultConfig,
plugins: [
del(deleteConfig),
...defaultConfig.plugins,
license(licenseConfig),
terser(terserConfig),
copy(copyConfig),
generateSW(workboxConfig)
],
preserveEntrySignatures: false
};
export default config;