Skip to content

jalal246/builderz

Repository files navigation

Builderz

Zero Configuration JavaScript Bundler :bowtie:

build/er/z is built originally to bundle monorepos for one-step production. And of course, it works for regular repo with a single package.

It does multiple things to save you some time and lets you focus on developing, that includes:

  1. Gets all validate packages path by looking into the workplace - for monorepo.

  2. Extract JSON from each package found in the workplace. To get essential production information.

  3. Cleans build folders if required.

  4. Creates camelize name for your package if required or deal with custom output name.

  5. If monorepo, sorts packages according to core/dependency, so core comes first and so on.

  6. Validate entries and aut-detect if src/entry or ./entry

  7. Creates a distension path for each project found with ability to name folder.

  8. If there's no targeted format, it generates default formats (CJS, UMD, ES) one cycle minified with a map and the second is not.

  9. Highly customized. Reads local package build args first, resolves local paths. Prioritize local args to global ones.

  10. Works as CLI and API.

Install

npm install builderz

Easy to use

In your packages.json to compile to a CommonJS module (cjs) and minify the bundle just pass the required args.

"build": "builderz --formats=cjs --minify=false"

Options

  -s, --silent <boolean>       Silent mode, mutes build massages (default: true)
  -f, --formats <list>         Specific build format (default: [])
  -m, --minify <boolean>       Minify bundle works only if format is provided (default: false)
  -c, --camel-case <boolean>   Add camel-cased output file (default: true)
  -l, --clean-build <boolean>  Clean previous build folder (default: false)
  -b, --build-name <string>    Specific folder build name (default: "dist")
  -o, --output <string>        Custom output name
  -w, --pkg-paths <list>       Provide custom paths not in the root/src (default: [])
  -n, --pkg-names <list>       Building specific package[s], in workspace (default: [])
  -a, --alias <list>           Package Alias (default: [])
  -e, --entries <list>         Add multi entries instead of default src/index. (default: [])
  -r, --banner <string>        Add banner to output
  -h, --help                   display help for command

Using Build Script

const builderz = require("builderz");

// Multi-word options are camel-cased. Pass list as array.
const options = {};

builderz(options);

Test

npm test

Related projects

License

This project is licensed under the GPL-3.0 License