A module bundler and REPL for your Node CLI tools with full TypeScript support
With your preferred package manager, add makke
as a dev dependency.
# npm
npm i makke -D
# pnpm
pnpm i makke -D
# yarn
yarn add makke -D
Create a file called makke.config.ts
in your project root.
import { defineConfig } from 'makke'
import { dependencies } from './package.json' assert { type: 'json' }
export default defineConfig({
// Alias your commands to make them easier to run.
aliases: [
'makke',
],
esbuild: {
entryPoints: ['./src/index.ts'],
external: Object.keys(dependencies),
outfile: './dist/bundle.js',
tsconfig: './tsconfig.json',
},
})
Add the following scripts to your package.json
file.
{
"scripts": {
"dev": "makke dev",
"build": "makke build"
}
}
Make sure you add .makke
to your .gitignore
. This folder is used to cache files in development.
Running makke dev
starts a REPL for you to run your custom commands. When your source files change, makke
instantly rebuilds your project with the speed of esbuild
.
When you are happy with the results of your project, run makke build
to creation a production build.