forked from Twint-AG/sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb-dev-server.config.mjs
More file actions
47 lines (41 loc) · 921 Bytes
/
web-dev-server.config.mjs
File metadata and controls
47 lines (41 loc) · 921 Bytes
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
import { esbuildPlugin } from '@web/dev-server-esbuild';
import proxy from 'koa-proxies';
export default {
port: 4000,
nodeResolve: true,
open: '/demo/',
watch: true,
middleware: [
proxy('/twint', {
target: 'http://localhost:9000',
changeOrigin: true,
logs: true,
events: {
error: (err, req, res) => {
console.error('[PROXY ERROR]', err);
},
proxyReq: (proxyReq, req, res) => {
console.log(`[PROXY] ${req.method} ${req.url} -> http://localhost:9000${req.url}`);
}
}
})
],
// Serve files
rootDir: '.',
// Plugin for handling modern JS
plugins: [
esbuildPlugin({
js: true,
target: 'auto'
})
],
// Log configuration
logLevel: 'info',
// MIME types for modules
mimeTypes: {
'**/*.js': 'js',
'**/*.mjs': 'js',
'**/*.html': 'html',
'**/*.css': 'css'
}
};