1 | // @ts-check
|
2 |
|
3 | const { argv } = process
|
4 | const build = process.env['NODE_ENV'] === 'build' || argv[argv.length - 1] === 'build'
|
5 | const { join } = require('path')
|
6 |
|
7 | /**
|
8 | * @type {import('./index').F2EConfig}
|
9 | */
|
10 | const config = {
|
11 | livereload: !build,
|
12 | build,
|
13 | gzip: true,
|
14 | useLess: true,
|
15 | middlewares: [
|
16 | { middleware: 'template', test: /\.html?/ },
|
17 | // () => {
|
18 | // return {
|
19 | // onRoute: p => {
|
20 | // if (!p) return 'index.html'
|
21 | // },
|
22 | // }
|
23 | // }
|
24 | ],
|
25 | output: join(__dirname, './output'),
|
26 | // onServerCreate: (server) => {
|
27 | // const { Server } = require('ws')
|
28 | // const wss = new Server({server});
|
29 | // wss.on('connection', (socket) => {
|
30 | // socket.send('init')
|
31 | // })
|
32 | // }
|
33 | }
|
34 | module.exports = config |
\ | No newline at end of file |