zenflow-build-js-lib
A minimal-config opinionated and awesome build system for portable js libs
Features
- convention over configuration
- rollup under the hood
- babel 6, with whatever presets and plugins you need
- cjs es & umd formats
- pretty banners with package name & version, filename, homepage & license
Conventions
- entry point will be
src/index.js
- externals (non-bundled imports) will be
"dependencies"
and"peerDependencies"
- package
"main"
refers to cjs format file (optional) - package
"module"
refers to es format file (optional) - package
"browser"
refers to umd format file (optional) - global export name will be camelized package name
- global import names will be camelized package names unless specified in
pkg.zenflowConfig.build.globals
option inpackage.json
CLI
zenflow-build-js-lib [--prod]
--prod
- "production mode" - produce sourcemaps and additional minified versions of all js files
Configs
This project strives to eliminate as much configuration as possible, but sometimes it's needed.
In your package.json
, at pkg.zenflowConfig.build
, add any of the following options:
"globals"
- Object mapping external package names to their global export names (e.g.{"react-dom": "ReactDOM"}
)
Example
package.json