https://github.com/zenflow/zenflow-build-js-lib
A zero-config opinionated and awesome build system for portable js libs
https://github.com/zenflow/zenflow-build-js-lib
Last synced: 5 months ago
JSON representation
A zero-config opinionated and awesome build system for portable js libs
- Host: GitHub
- URL: https://github.com/zenflow/zenflow-build-js-lib
- Owner: zenflow
- License: mit
- Created: 2018-03-13T15:08:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T18:11:58.000Z (about 6 years ago)
- Last Synced: 2025-09-23T02:48:01.466Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 231 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# zenflow-build-js-lib
A minimal-config opinionated and awesome build system for portable js libs
[](https://travis-ci.org/zenflow/zenflow-build-js-lib)
[](https://github.com/facebook/jest)
[](https://www.npmjs.com/package/zenflow-build-js-lib)
[](https://david-dm.org/zenflow/zenflow-build-js-lib)
[](https://greenkeeper.io/)
[](https://github.com/zenflow/zenflow-build-js-lib/blob/master/CHANGELOG.md)
[](https://opensource.org/licenses/MIT)
## 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 in `package.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
```json
{
"name": "example",
"version": "1.0.0",
"main": "dist/example.cjs.js",
"module": "dist/example.es.js",
"browser": "dist/example.umd.js",
"files": [
"dist/**/*"
],
"homepage": "HOMEPAGE",
"license": "LICENSE",
"scripts": {
"build": "zenflow-build-js-lib --prod"
},
"peerDependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"devDependencies": {
"zenflow-build-js-lib": "^1.0.0"
},
"zenflowConfig": {
"build": {
"globals": {
"react": "React",
"react-dom": "ReactDOM"
}
}
}
}
```