A zero-config opinionated and awesome build system for portable js libs
MIT License
A minimal-config opinionated and awesome build system for portable js libs
src/index.js
"dependencies"
and "peerDependencies"
"main"
refers to cjs format file (optional)"module"
refers to es format file (optional)"browser"
refers to umd format file (optional)pkg.zenflowConfig.build.globals
option in package.json
zenflow-build-js-lib [--prod]
--prod
- "production mode" - produce sourcemaps and additional minified versions of all js filesThis 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"}
)package.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"
}
}
}
}