The JavaScript ecosystem is complex and continually evolving. This is an attempt to simplify it. Goals of this project:
crunchicorn takes two arguments:
<script src=...>
element. Transpiled,
resolved, validated, crunched, everything.crunchicorn was born out of frustration with how complicated it is to get JavaScript tooling setup for real world projects.
Assuming you keep your source tree in src/
, which contains ES2015 syntax code, imports, CSS, etc, and the entry point is src/myapp.js
.
This single command (no config necessary) will do everything to validate, transpile, resolve modules, drop dead code, and compress into a single file:
$ crunchicorn src/myapp.js out/myapp.js
The resulting file is now ready to be used directly in your web-app. It will include all dependencies and even inject your CSS:
<script src="https://github.com/joewalnes/crunchicorn/raw/master/myapp.js"></script>
Voila. No config - it just worked!
You can leave crunchicorn running and it will automatically rebuild whenever it notices any files have changed:
$ crunchicorn --watch src/myapp.js out/myapps.js
Install globally:
$ npm install -g crunchicorn
Alternatively, install just for your current project:
$ npm install --save-dev crunchicorn
Or in package.json
:
{
"dependencies": {
"crunchicorn": "*"
}
}
Note: If not installed globally, you'll need to include node_module/.bin in your path
For help:
$ crunchicorn --help