https://github.com/devnax/makepack
MakePack is a command-line interface (CLI) tool that helps you to quickly set up, build, and manage JavaScript, TypeScript, React, and React-TypeScript libraries for use in npm projects.
https://github.com/devnax/makepack
cli javascript javascript-library makepack react reactjs typescript typescript-library
Last synced: 11 months ago
JSON representation
MakePack is a command-line interface (CLI) tool that helps you to quickly set up, build, and manage JavaScript, TypeScript, React, and React-TypeScript libraries for use in npm projects.
- Host: GitHub
- URL: https://github.com/devnax/makepack
- Owner: devnax
- Created: 2024-12-26T08:04:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-19T03:42:38.000Z (12 months ago)
- Last Synced: 2025-07-04T17:17:17.135Z (11 months ago)
- Topics: cli, javascript, javascript-library, makepack, react, reactjs, typescript, typescript-library
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/makepack
- Size: 313 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Makepack
**MakePack** is a command-line interface (CLI) tool that helps you to quickly set up, build, and manage JavaScript, TypeScript, React, and React-TypeScript libraries for use in npm projects. With just a few simple commands, you can generate your own libraries, start a development server, or build and publish your project to the npm repository.
## 📥 Installation
Install `makepack` globally to get started:
```sh
npm install -g makepack
```
---
## 🎯 Why Choose makepack?
- **Zero-Config Setup** – Instantly scaffold a structured project.
- **TypeScript Support** – Seamlessly work with modern JavaScript.
- **Integrated Dev Server** – Run your package with Vite and Express.
- **Efficient Build System** – Generate optimized ESM and CJS outputs.
- **One-Command Publish** – Deploy your package to npm effortlessly.
---
## 📜 CLI Commands
### ✨ `makepack create` – Scaffold a New Project
Quickly initialize a structured package with the following setup:
```
src/index.ts or tsx or js or jsx
.gitignore
package.json
README.md
```
Run:
```sh
makepack create
```
Follow the interactive prompts to configure your project.
### 🚀 `makepack start` – Launch the Development Server
Run a Vite + Express server to develop and test your package in real-time.
```sh
makepack start
```
### 🏗️ `makepack build` – Compile Your Package
Builds and optimizes your package into the `build` directory.
```sh
makepack build
```
### 📦 `makepack publish` – Deploy to NPM
Publish your package to the npm registry in one command.
```sh
makepack publish
```
---
## ⚙️ Configuration
Customize your project by creating a `makepack.js` file in the root directory. This file allows full control over the build and dev environment.
### 🔧 Default Configuration
```js
module.exports = (prevConfig) => ({
build: {
outdir: "build",
types: true,
formatPackageJson: (p) => p,
configs: [
{
entryPoints: "src/**/*.{tsx,ts,js,jsx}",
outdir: "esm",
format: "esm",
sourcemap: true,
jsx: 'automatic',
loader: {
'.ts': 'ts',
'.tsx': 'tsx'
},
},
{
entryPoints: "src/**/*.{tsx,ts,js,jsx}",
outdir: "",
format: "cjs",
sourcemap: true,
jsx: 'automatic',
loader: {
'.ts': 'ts',
'.tsx': 'tsx'
},
}
]
},
start: {
port: 5000,
entry: "App.tsx",
}
});
```
---
## 📜 License
`makepack` is released under the **MIT License**, allowing free usage in both open-source and commercial projects.
---
🚀 **Start building your next NPM package with `makepack` today!**
