Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
barely-a-dev-server
Advanced tools
A thin, opinionated wrapper for [`esbuild`](https://github.com/evanw/esbuild) as a `.ts` web server. Given an `entryRoot` folder, it:
barely-a-dev-server
A thin, opinionated wrapper for esbuild
as a .ts
web server. Given an entryRoot
folder, it:
.ts
files under entryRoot
and uses them as entry files to run esbuild
in watch
mode, and.js
files together with a fallback to entryRoot
for static files.
/
are mapped to index.html
in the corresponding folder.When run with "dev": false
, it writes these files to an output dir (dist/
+ the entry root by default), ready to serve using your favorite static file server.
Install with:
npm install -D barely-a-dev-server
// script/build.js
import { barelyServe } from "barely-a-dev-server";
barelyServe({
entryRoot: "src", // the only required arg
dev: true,
port: 3333,
esbuildOptions: {
target: "esnext",
},
});
<!-- src/index.html -->
<script src="./index.js" href="./index.ts" type="module" defer></script>
// src/index.ts
const a: number = 4;
console.log(a);
(Note that src
must reference the generated .js
file, not .ts
. The example shows an ergonomic hack: you can use href
to store a reference to the .ts
source, so that you can e.g. "Follow link" in VSCode.)
barely-a-dev-server
?esbuild
, which is very fast and robust.
esbuild
.barely-a-dev-server
?esbuild
's --servedir
arg during dev, and cp -R
for a build.node -e 'import("barely-a-dev-server").then(s => s.barelyServe({entryRoot: "src"}))'
.ts
file under the entryRoot
as an entry point. esbuild
handles this very well, but this may result in significantly more output files than expected/needed.
These are mostly because it would make the codebase significantly larger to support them properly.
FAQs
A thin, opinionated wrapper for [`esbuild`](https://github.com/evanw/esbuild) as a `.ts` web server. Given an `entryRoot` folder, it:
We found that barely-a-dev-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.