Standalone Bun + OXC build spine extracted from Manic.
Use this package if you want to build your own framework/runtime while reusing the Manic build pipeline primitives.
buildApplication()pipeline orchestration- bundler utilities:
resolver,countRoutes,getDirSize,minifyDir,formatSize,formatTime - plugin/provider hook contracts
- CLI entrypoint:
manic-bundler build
bun add @manicjs/bundlerimport { buildApplication, type PageRoute } from '@manicjs/bundler';
const config = {
mode: 'fullstack',
app: { name: 'My Framework App' },
};
await buildApplication({
config,
dist: '.dist',
runLint: true,
writeRoutesManifest: async () => {
// your manifest writer
},
discoverPageRoutes: async (): Promise<PageRoute[]> => {
// your route discovery
return [];
},
clientPlugins: [],
serverPlugins: [],
plugins: [],
providers: [],
onPending: msg => console.log(`[bundler] ${msg}`),
onSuccess: msg => console.log(`[bundler] ${msg}`),
onError: msg => console.error(`[bundler] ${msg}`),
});manic-bundler build bundler.config.tsExample bundler.config.ts:
export default {
config: {
mode: 'fullstack',
app: { name: 'Standalone App' },
},
dist: '.dist',
clientPlugins: [],
serverPlugins: [],
};By default, the pipeline expects:
- app entry resolved from
./app/main - server entry at
./~manic - API entries at
app/api/**/index.ts(when mode is notfrontend)
If your framework layout differs, wrap/adapt route discovery and entry generation around buildApplication().
name: stringpreload?: stringbuild?(ctx): void | Promise<void>
name: stringbuild(context): void | Promise<void>
For third-party compatibility:
- keep optimization conservative by default
- avoid blanket side-effect stripping of external packages
- validate with smoke tests (
build -> start -> endpoint checks)