forked from gramps-project/gramps-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
49 lines (40 loc) · 974 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
37
38
39
40
41
42
43
44
45
46
47
48
49
import merge from 'deepmerge'
import copy from 'rollup-plugin-copy'
import {createSpaConfig} from '@open-wc/building-rollup'
import replace from '@rollup/plugin-replace'
const API_URL = (process.env.API_URL === undefined)
? ''
: process.env.API_URL
const BASE_DIR = (process.env.BASE_DIR === undefined)
? ''
: process.env.BASE_DIR
const baseConfig = createSpaConfig({
developmentMode: process.env.ROLLUP_WATCH === 'true',
injectServiceWorker: true,
workbox: {
navigateFallbackDenylist: [/^\/api.*/],
},
html: {
transform: [
(html) =>
html.replace(
'<base href="/">',
`<base href="/${BASE_DIR}">`
),
],
},
})
export default merge(baseConfig, {
input: './index.html',
plugins: [
copy({
targets: [
{src: './leaflet.css', dest: 'dist/'},
{src: './images/**/*', dest: 'dist/images'}
]
}),
replace({
'http://localhost:5555': API_URL
})
]
})