Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
esbuild-dev-server
Advanced tools
This plugin allows you to start a local server with hot reloading for Esbuild
More community plugins
npm
npm i esbuild-dev-server -D
yarn
yarn add esbuild-dev-server -D
go
go get github.com/Falldot/esbuild-dev-server
options.port
, string
: local server start port.options.index
, string
: path to index html file.options.staticDir
, string
: path to static files (js, css, img ...).options.watchDir
, string
: path to working directory.options.onBeforeRebuild
, () => void
: event before rebuild.options.onAfterRebuild
, () => void
: event after rebuild.esbuild.config.js
const {build} = require("esbuild")
const esBuildDevServer = require("esbuild-dev-server")
esBuildDevServer.start(
build({
entryPoints: ["src/index.js"],
outdir: "dist",
incremental: true,
// and more options ...
}),
{
port: "8080", // optional, default: 8080
watchDir: "src", // optional, default: "src"
index: "dist/index.html", // optional
staticDir: "dist", // optional
onBeforeRebuild: {}, // optional
onAfterRebuild: {}, // optional
}
)
package.json
"scripts": {
"dev": "node esbuild.config.js",
},
dist/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="root"></div>
<script src="index.js"></script>
</body>
</html>
esbuild.config.go
package main
import (
devserver "github.com/Falldot/esbuild-dev-server"
"github.com/evanw/esbuild/pkg/api"
)
func main() {
devserver.Start(
api.Build(api.BuildOptions{
EntryPoints: []string{"src/index.js"},
Outdir: "dist",
Incremental: true,
// and more options ...
}),
devserver.Options{
Port: "8080", // optional, default: 8080
WatchDir: "src", // optional, default: "src"
Index: "dist/index.html", // optional
StaticDir: "dist", // optional
OnBeforeRebuild: func() {}, // optional
OnAfterRebuild: func() {}, // optional
},
)
}
package.json
"scripts": {
"dev": "go esbuild.config.go",
},
FAQs
An fast JavaScript hot dev local server.
We found that esbuild-dev-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.