-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup-dev.config.js
56 lines (50 loc) · 1.36 KB
/
rollup-dev.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
import defaultConfig from './rollup.config.js';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import copy from 'rollup-plugin-copy';
// For livereload to work you need to expose port in docker-compose.yaml with ports: -"3003:3003"
const appPort = 8080;
const liveReloadPort = 3003;
console.log("\x1b[92m" + "Starting app on port:" + appPort + " \x1b[0m");
console.log("\x1b[92m" + "LiveReload starting on port:" + liveReloadPort + " \x1b[0m");
console.log("\x1b[93m" + "LiveReload Hint: If live reload is not working you probably must expose port " + liveReloadPort + " in docker-compose.yaml" + " \x1b[0m");
// Extra files to copy in src directory ./src
const copyConfig = {
targets: [
{
src: 'src_ts/**/*.json',
dest: 'src'
}
],
copyOnce: true,
flatten: false
};
const config = {
...defaultConfig,
output: {
dir: 'src',
format: 'es',
sourcemap: true,
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
},
watch: {
include: ['src_ts/**', 'node_modules/**']
},
plugins: [
...defaultConfig.plugins,
copy(copyConfig),
serve({
historyApiFallback: true,
openPage: 'index.html',
port: appPort
}),
livereload({
port: liveReloadPort,
verbose: true,
delay: 1000,
watch: ['src'],
}),
]
}
export default config;