esbuild-serve

Usage
> npx @hyrious/esbuild-serve
[esbuild-serve] serving http://localhost:3000
> npx @hyrious/esbuild-serve --build
Description
This is a simple wrapper of esbuild --serve, which enables auto reload and zero-config development. You even don't need an index.html.
Note: By default, it looks for the only one bundle target in the order of {index,main,src/index,src/main}.{js,jsx,ts,tsx}. Bundle result is index.js by default.
Difference to vite: Vite doesn't do bundle in development for the best speed. This tool does bundle everything into a single file.
Config
Create an esbuild.config.ts with contents below:
import { defineConfig } from "@hyrious/esbuild-serve";
export default defineConfig({
});
Or if you hate typescript, an example esbuild.config.js will be:
module.exports = {
};
Configs:
import { BuildOptions, ServeOptions } from "esbuild";
interface UserConfig {
build: BuildOptions;
serve: ServeOptions;
}
License
MIT @ hyrious