内容简介:In yourOr even:
Builderz
Zero Configuration JavaScript Bundler
build/er/z
is built originally to bundle monorepos, expanded later to cover
more build cases with a wide variety of options. It implements rollup, taking
advantage of its simplicity and customization to build
one-step production bundler.
Install
npm install builderz
Easy to use
"build": "builderz"
Easy to customize
In your packages.json
to compile to a CommonJS module (cjs) and minify the
bundle just pass the required arguments.
"build": "builderz --formats=cjs --minify"
Or even:
"scripts": {
"build":"...",
"test": "..."
},
"builderz":{
"formats": ["cjs"],
"minify": true,
}
Of course you cane import it as build package somewhere in your project:
const builderz = require("builderz");
// Multi-word options are camel-cased. Pass list as array.
const options = {};
builderz(options);
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) -m, --sourcemap <boolean> Enable sourcemap in output -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 -d, --es-module <string> Define Property exports (default: false) -t, --strict <string> Enable Strict Mode (default: false) -h, --help display help for command
Under the hood
It does multiple things to save you some time and lets you focus on developing, that includes:
-
Gets all validate packages by path or even names, by looking into the workplace for monorepo and root directory for one single package.
-
Extract
JSONfrom each package found in the workplace. To get essential production information. -
Cleans build folders if required.
-
Creates camelize output name, bundles according to given name or just leaves it as it is with the original name in package.json
-
If monorepo, sorts packages according to
core/dependency, so core comes first and so on. -
Validates entries and aut-detect if
src/entryor./entry -
Creates a distension path for each project found.
-
If there's no targeted format, it generates default formats
(CJS, UMD, ES)one cycle minified with a map and the second is not. -
Highly customized. Reads local package build args first, resolves local paths. Prioritize local args to global ones.
Test
npm test
Related projects
-
packageSorter - Sorting packages for monorepos production.
-
corename - Extracts package name.
-
get-info - Utility functions for projects production.
-
validate-access - Validate project accessibility files.
-
move-position - Moves element in an array from index to another.
-
textics & textics-stream - Counts lines, words, chars and spaces for a given string.
License
This project is licensed under the GPL-3.0 License
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Compilers
Alfred V. Aho、Monica S. Lam、Ravi Sethi、Jeffrey D. Ullman / Addison Wesley / 2006-9-10 / USD 186.80
This book provides the foundation for understanding the theory and pracitce of compilers. Revised and updated, it reflects the current state of compilation. Every chapter has been completely revised ......一起来看看 《Compilers》 这本书的介绍吧!