-
Notifications
You must be signed in to change notification settings - Fork 21
/
snowpack.config.js
63 lines (61 loc) · 1.37 KB
/
snowpack.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
// Snowpack Configuration File
// See all supported options: https://www.snowpack.dev/reference/configuration
import proxy from 'http2-proxy'
import { nodeResolve } from '@rollup/plugin-node-resolve'
export default {
mount: {
// the web frontend is located in this directory
'./app/client': { url: '/' }
},
plugins: ['@snowpack/plugin-babel'],
mode: 'development',
packageOptions: {
rollup: {
plugins: [
// todo: related to the lit documentation this should enable development mode
// unfortunately this currently does not seem to work
nodeResolve({
exportConditions: ['development'],
dedupe: true
})
]
}
},
devOptions: {
open: 'none',
output: 'stream'
},
buildOptions: {
out: 'build'
},
optimize: {
bundle: true,
treeshake: true,
minify: false,
target: 'es2020',
sourcemap: false
},
// add a proxy for websocket requests for the dev setting
routes: [
{
src: '/websocket',
upgrade: (req, socket, head) => {
const defaultWSHandler = (err, req, socket, head) => {
if (err) {
socket.destroy()
}
}
proxy.ws(
req,
socket,
head,
{
hostname: 'localhost',
port: 80
},
defaultWSHandler
)
}
}
]
}