Serpack
Overview
Introduction

Introduction

Introduction of serpack

Serpack is a TypeScript/JavaScript compiler for application development, powered by swc.

This compiler is optimized for high-speed bundling and execution of TypeScript files, leveraging swc as a transformer and oxc as a resolver for enhanced performance.

By default, serpack is built to run Javascript/Typescript, but it also supports module bundling.

Terminal
npx serpack ./src/awesome-app.ts # run script

WARNING

Although serpack is mostly stable, undiscovered issues may still occur.

#Why?

esbuild is an excellent bundler, but Zely is a framework with its own unique requirements and ecosystem.
Therefore, developing a custom bundler, serpack, tailored specifically for Zely, offers better technical independence, optimized performance, and a more seamless developer experience

#How Does It Work?

The core mechanism of serpack is straightforward. When serpack compiles a TypeScript or JavaScript file, it first uses SWC to transform all files into JavaScript. Then, it analyzes the compiled output to apply features like plugins and modifiers. Finally, it bundles multiple files into a single output using Serpack's built-in bundling system. That's all.

#Getting Started


  1. try serpack on zely
Terminal
npx zely dev --serpack # or npx zely-cli dev --serpack

Enable --serpack flag


  1. try serpack on your project
Terminal
npm i --save-dev serpack

#Source Code

github.com/zely-js/serpack