@rawscript/cli
v0.3.1
Published
CLI for rawscript: bundle in-browser TypeScript apps and serve them
Readme
@rawscript/cli
Production builds for @rawscript/runtime projects — bundle in-browser TypeScript apps into static output with no rawscript runtime in it.
Install
npm i -D @rawscript/cliThe installed command is rawscript (not @rawscript/cli):
npx rawscript buildFor a one-off run without installing, use the package name:
npx @rawscript/cli build.
Commands
rawscript build # bundle index.html entries with esbuild -> dist/
rawscript build --typecheck # run real tsc first, abort on type errors
rawscript build --local-deps # bundle npm deps from local node_modules, no CDN
rawscript typecheck # type-check only (noEmit), exit 1 on errors
rawscript serve # zero-config static dev server on :3000
rawscript preview --dir dist # serve production output as it deploys
rawscript deps # bundle local deps + emit importmap.json
rawscript vendor --dir rawscript # copy runtime + esbuild-wasm in for self-hostingrawscript build reads index.html, finds every
<script type="module" src="*.ts">, bundles with the esbuild Node API, and
writes to dist/. The output contains no reference to rawscript and no
in-browser transpilation.
By default npm dependencies stay externalized through an esm.sh import map, so
production output needs network access to esm.sh. With --local-deps they are
bundled from your node_modules and the output is fully self-contained.
npm/pnpm remain the dependency authority — run your install first. A missing dependency fails the build with an actionable message rather than silently falling back to the CDN.
Requirements
Node >= 18.
Documentation
https://github.com/rawscriptdev/rawscript — production guide, troubleshooting, security model.
MIT © rawscript contributors
