mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 12:51:55 +00:00
use esbuild live reload (#49999)
Now, after you save a file in your editor, the web browser will automatically perform a full-page reload so that your changes are reflected. See https://esbuild.github.io/api/#live-reload. (Note: Unlike "hot module reloading", this performs a full-page reload, not an in-place reload. It's still a nice time-saver.)
This commit is contained in:
parent
2309720c00
commit
fb86fe693e
@ -28,6 +28,8 @@ export const esbuildDevelopmentServer = async (
|
||||
|
||||
const ctx = await esbuildContext(BUILD_OPTIONS)
|
||||
|
||||
await ctx.watch()
|
||||
|
||||
// Start esbuild's server on a random local port.
|
||||
const { host: esbuildHost, port: esbuildPort } = await ctx.serve({
|
||||
host: 'localhost',
|
||||
|
||||
@ -35,3 +35,9 @@ window.addEventListener('DOMContentLoaded', async () => {
|
||||
logger.error('Failed to initialize the app shell', error)
|
||||
}
|
||||
})
|
||||
|
||||
if (process.env.DEV_WEB_BUILDER === 'esbuild' && process.env.NODE_ENV === 'development') {
|
||||
new EventSource('/.assets/esbuild').addEventListener('change', () => {
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@
|
||||
"css-loader": "^6.7.2",
|
||||
"css-minimizer-webpack-plugin": "^4.2.2",
|
||||
"envalid": "^7.3.1",
|
||||
"esbuild": "^0.17.7",
|
||||
"esbuild": "^0.17.14",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-plugin-monorepo": "^0.3.2",
|
||||
"events": "^3.3.0",
|
||||
|
||||
1857
pnpm-lock.yaml
1857
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user