Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@hyrious/esbuild-serve

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyrious/esbuild-serve

simple watch and reload server with esbuild

Source
npmnpm
Version
0.3.3
Version published
Weekly downloads
2
-96.77%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-serve

GitHub Repo total lines npm package install size

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:

/** @type {import('@hyrious/esbuild-serve').UserConfig} */
module.exports = {
  // ...
};

Configs:

import { BuildOptions, ServeOptions } from "esbuild";
interface UserConfig {
  build: BuildOptions;
  serve: ServeOptions;
}

License

MIT @ hyrious

FAQs

Package last updated on 05 Jun 2021

Did you know?

Socket

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.

Install

Related posts