{"id":24980,"library":"barely-a-dev-server","title":"barely-a-dev-server","description":"A thin, opinionated wrapper for esbuild that watches and serves TypeScript files as ESM. Current stable version: 0.8.3. Release cadence: irregular, with multiple minor releases in 2024. Key differentiators: minimal codebase (<200 lines), zero runtime dependencies beyond esbuild, automatic source maps, and integrated dev server that maps entry .ts files to .js. Unlike esbuild's own --servedir, this directly serves compiled output with live rebuilds. No CLI, no live reload, no non-TS transformations. Requires Node >=19 or Bun >=1.0.30.","status":"active","version":"0.8.3","language":"javascript","source_language":"en","source_url":"https://github.com/lgarron/barely-a-dev-server","tags":["javascript","typescript"],"install":[{"cmd":"npm install barely-a-dev-server","lang":"bash","label":"npm"},{"cmd":"yarn add barely-a-dev-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add barely-a-dev-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler and transpiler for TypeScript compilation, watch mode, and file serving.","package":"esbuild","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require() will fail. Named export, not default.","wrong":"const barelyServe = require('barely-a-dev-server')","symbol":"barelyServe","correct":"import { barelyServe } from 'barely-a-dev-server'"},{"note":"Default import is incorrect; use named import with braces.","wrong":"import barelyServe from 'barely-a-dev-server'","symbol":"barelyServe","correct":"import { barelyServe } from 'barely-a-dev-server'"}],"quickstart":{"code":"// script/build.js\nimport { barelyServe } from 'barely-a-dev-server';\n\nbarelyServe({\n  entryRoot: 'src',\n  dev: true,\n  port: 3333,\n  esbuildOptions: {\n    target: 'esnext',\n  },\n});","lang":"typescript","description":"Starts a dev server on port 3333 that watches and serves TypeScript files from the 'src' directory as ESM with source maps."},"warnings":[{"fix":"If you relied on custom glob patterns, update your entry points to match esbuild's built-in resolution.","message":"v0.6.0 changed file globbing to rely on esbuild, which may break builds expecting custom pattern matching.","severity":"breaking","affected_versions":">=0.6.0 <0.8.0"},{"fix":"Place library files outside entryRoot; only keep actual entry scripts inside.","message":"All .ts files under entryRoot are treated as entry points, potentially generating many output files.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade to >=0.7.0 and use bundleCSS option if CSS bundling is needed.","message":"v0.7.0 introduced bundleCSS option; prior versions do not support CSS bundling.","severity":"deprecated","affected_versions":"<0.7.0"},{"fix":"In <script> tags, set src='./index.js' (not .ts). The href attribute is informational only.","message":"HTML files must reference .js output, not .ts source; the 'href' attribute is not processed by the server.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check your code for ES2022 compatibility; override esbuildOptions.target if needed.","message":"v0.8.0 uses @cubing/dev-config/esbuild/es2022 under the hood, which may change build defaults (e.g., target).","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Update Bun to >=1.0.30 or use Node >=19.","message":"v0.6.1 removed a workaround for Bun; Bun >=1.0.30 is now required.","severity":"breaking","affected_versions":">=0.6.1"},{"fix":"Write a small script calling barelyServe() or run: node -e 'import(\"barely-a-dev-server\").then(s => s.barelyServe({entryRoot: \"src\"}))'","message":"No CLI; you must import and call barelyServe manually or use node -e.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.8.3':23 '1.0.30':86 '19':83 '200':37 '2024':32 'automat':44 'bare':2 'barely-a-dev-serv':1 'beyond':42 'bun':85 'cadenc':25 'cli':72 'codebas':36 'compil':66 'current':20 'depend':41 'dev':4,49 'differenti':34 'direct':64 'entri':53 'esbuild':11,43,59 'esm':19 'file':17,55 'integr':48 'irregular':26 'javascript':87 'js':57 'key':33 'line':38 'live':69,74 'map':46,52 'minim':35 'minor':29 'multipl':28 'node':82 'non':78 'non-t':77 'opinion':8 'output':67 'rebuild':70 'releas':24,30 'reload':75 'requir':81 'runtim':40 'serv':15,65 'servedir':62 'server':5,50 'sourc':45 'stabl':21 'thin':7 'transform':80 'ts':54,79 'typescript':16,88 'unlik':58 'version':22 'watch':13 'wrapper':9 'zero':39","created_at":"2026-05-01T13:42:23.542289+00:00","updated_at":"2026-05-01T13:42:23.542289+00:00","problems":[{"fix":"Use import syntax: import { barelyServe } from 'barely-a-dev-server'","cause":"Trying to use CommonJS require() on an ESM-only package.","error":"Error: Cannot find module 'barely-a-dev-server'"},{"fix":"Correct import: import { barelyServe } from 'barely-a-dev-server'","cause":"Using default import instead of named import.","error":"TypeError: barelyServe is not a function"},{"fix":"Ensure entryRoot is relative to current working directory and contains .ts files.","cause":"Entry root contains .ts files that esbuild cannot resolve; possibly wrong path or missing file.","error":"Failed to resolve entry point \"src/index.ts\""}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/lgarron/barely-a-dev-server","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/barely-a-dev-server","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}