@warp-ecosystem/warp-compiler
v0.3.0
Published
Compile multiple JavaScript modules into a single TurboWarp extension.
Maintainers
Readme
Warp Compiler (warp-compiler)
[!WARNING] Support for Node.js v18 Node.js 18 reached end of life on April 30, 2025. Support for Node.js 18 will end on Friday, September 4th, 2026. Warp Compiler may still work with Node.js v18, but releases may no longer test for compatability with Node.js v18.
Overview
Warp Compiler is a Node tool to compile multiple JavaScript files into a single, highly readable TurboWarp extension. It is designed with larger extensions in mind.
Features
- Compile many files into one — Bundles
src/00-index.jsand anything it imports into a single, readable TurboWarp extension file. - Keeps only what you need — Retains every exported function and any
function referenced by a block's
opcode/function, while dropping unreachable code so the output stays small and clean. - Inline assets — Auto-embeds referenced files from
assets/as base64 data URIs, preserving nested folder paths. Unreferenced assets are left out, and dynamic asset lookups are rejected so tree-shaking stays reliable. - Runtime metadata — Emits a statically parseable
<runtimeGlobal> = { meta, assets }object (no comment header), so the manifest stays in sync with the extension at runtime. - Consistency checks — Warns (without failing) when source or
package.jsonvalues drift from the manifest. - Beautiful output — The result is formatted with Prettier for readability.
- Minimal dependencies — Only four runtime packages, the ones
src/build.jsactually imports (rollup,acorn,prettier, andpicocolors); nothing heavier is pulled in.
Installation
To install Warp Compiler with npm, run:
npm install --save-dev @warp-ecosystem/warp-compiler
# Ensure it installed properly
npx warp-compiler -vInstalling locally
You can also install Warp Compiler locally with git and npm:
git clone https://github.com/warp-ecosystem/warp-compiler.git
cd warp-compiler
npm installUsage
To initialize your project:
npx warp-compiler initTo compile your extension:
npx warp-compiler build
Contributing
Contributions are welcome! Please read the CONTRIBUTING.md for details on the process for submitting pull requests, and our Code of Conduct for community guidelines.
License
Warp Compiler is proud to be Free Software. It is licensed under the Apache 2.0 license.
