-
Notifications
You must be signed in to change notification settings - Fork 2
/
snowpack.config.js
42 lines (40 loc) · 1009 Bytes
/
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
const production = process.env.NODE_ENV === 'production';
const development = process.env.NODE_ENV === 'development' || process.env.NODE_ENV == undefined;
let mount;
if (production) {
mount = {
'source/frontend': '/',
};
} else if (development) {
mount = {
'content': { url: '/', static: true, resolve: false },
'source/frontend': '/',
};
}
module.exports = {
mount,
proxy: {
'/api': 'http://localhost:4000/api',
'/login': {
target: 'http://localhost:4000',
},
'/export': {
target: 'http://localhost:4000',
},
},
plugins: [
['@snowpack/plugin-build-script', { cmd: 'postcss', input: ['.css'], output: ['.css'] }],
// ['@snowpack/plugin-optimize', {}], // can not enable this as in combination with the webpack plugin errors __SNOWPACK__ENV
// ['@snowpack/plugin-webpack', {}],
],
devOptions: {
out: 'build/frontend',
fallback: 'index.html',
hmrErrorOverlay: false,
},
buildOptions: {
clean: true,
metaDir: '__meta__',
webModulesUrl: '__modules__',
},
};