-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdev.js
More file actions
34 lines (31 loc) · 723 Bytes
/
dev.js
File metadata and controls
34 lines (31 loc) · 723 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
/* eslint-disable import/no-extraneous-dependencies */
const path = require('path')
const esbuild = require('esbuild')
const nodemon = require('nodemon')
const config = {
entryPoints: ['src/server.jsx'],
bundle: true,
platform: 'node',
outfile: path.join(process.cwd(), 'build/server.js'),
loader: { '.node': 'copy' },
plugins: [],
logLevel: 'info',
}
// eslint-disable-next-line no-lone-blocks
{
(async () => {
let ctx = await esbuild.context(config)
await ctx.watch()
nodemon({
script: 'build/server.js',
legacyWatch: true,
delay: 2000,
stdin: false,
})
nodemon.on("start", () => {
console.log("App has started")
}).on("restart", () => {
console.log("App restarted")
})
})()
}