Run and build web code with Rspack.
1,307
stars
634
commits
JavaScript
primary language
Jul 17, 2026
updated
Jetpack is preconfigured Rspack for web code: one command to start a dev server, one command to build production assets, and a config file only when you need it.
npm install -g jetpack
jetpack
jetpack build
Jetpack requires Node 20 or newer and is published as ESM.
Start a dev server on http://localhost:3030:
jetpack
Build into dist/:
jetpack build
Point Jetpack at another file or project:
jetpack ~/Desktop/magic.js
jetpack --dir ~/projects/app
Inspect, clean, or check browser targets:
jetpack inspect
jetpack clean --dry-run
jetpack browsers --coverage=GB
Most projects do not need config. When you do, add jetpack.config.js, jetpack.config.mjs, or jetpack.config.cjs. Keep common app options top-level and put build/HTML shell settings under build and html.
import { defineConfig } from 'jetpack'
export default defineConfig({
entry: '.',
port: 3030,
assetBaseUrl: '/assets/',
dev: {
overlay: true
},
build: {
outDir: 'dist',
chunkLoadRetry: true
},
html: {
title: 'my-app'
},
css: {
modules: true
}
})
Mount Jetpack into your own server after the API routes:
import { serve } from 'jetpack/serve'
app.get('/api/unicorns', (req, res) => res.json([]))
app.use(serve())
serve() resolves Jetpack config on the first request and caches the middleware. It uses process.cwd() as the default project directory, proxies to the Jetpack dev server outside production, and serves build.outDir in production. For monorepos, pass the client directory:
app.use(serve({ dir: clientDir }))
JavaScript
97.9%
TypeScript
1.3%
Run and build web code with Rspack.
1,307
stars
634
commits
JavaScript
primary language
Jul 17, 2026
updated
Jetpack is preconfigured Rspack for web code: one command to start a dev server, one command to build production assets, and a config file only when you need it.
npm install -g jetpack
jetpack
jetpack build
Jetpack requires Node 20 or newer and is published as ESM.
Start a dev server on http://localhost:3030:
jetpack
Build into dist/:
jetpack build
Point Jetpack at another file or project:
jetpack ~/Desktop/magic.js
jetpack --dir ~/projects/app
Inspect, clean, or check browser targets:
jetpack inspect
jetpack clean --dry-run
jetpack browsers --coverage=GB
Most projects do not need config. When you do, add jetpack.config.js, jetpack.config.mjs, or jetpack.config.cjs. Keep common app options top-level and put build/HTML shell settings under build and html.
import { defineConfig } from 'jetpack'
export default defineConfig({
entry: '.',
port: 3030,
assetBaseUrl: '/assets/',
dev: {
overlay: true
},
build: {
outDir: 'dist',
chunkLoadRetry: true
},
html: {
title: 'my-app'
},
css: {
modules: true
}
})
Mount Jetpack into your own server after the API routes:
import { serve } from 'jetpack/serve'
app.get('/api/unicorns', (req, res) => res.json([]))
app.use(serve())
serve() resolves Jetpack config on the first request and caches the middleware. It uses process.cwd() as the default project directory, proxies to the Jetpack dev server outside production, and serves build.outDir in production. For monorepos, pass the client directory:
app.use(serve({ dir: clientDir }))
JavaScript
97.9%
TypeScript
1.3%