README
What is pinion?
- Opinionated - modeled to mimic the rails asset pipeline, tasks are default to just work
- Fast - designed for speed
- Customisable - the
pinionfile
allows tweaking of the pipeline to match your workspace
pinion was born to replace the Rails asset pipeline, in a Rails workspace. Benefits over the Rails asset pipeline include:
- speed
- modernness (support for CommonJS)
- less "magic" (everything is a gulp task)
Installing
npm install pinion-pipeline
will install the package locally
npm install -g pinion-pipeline
will provide a pinion
CLI for you to use. Or, you can just $(npm bin)/pinion
in your local workspace.
Usage
pinion's CLI is designed to mimic gulp.
pinion
is equivalent topinion default
pinion x
runs the taskx
pinion x y z
runs the tasksx
,y
, and thenz
pinionfile.js
Sample Not much is required to get going with simple tasks
module.exports = {
tasks: {
// build from src/javascripts/app.js to bin/bundle.js
js: {
entries: {
bundle: ['app.js']
}
},
// build from src/stylesheets/*.{scss,css} to bin/*.css
css: {},
// build from src/images/* to bin/*
images: {}
}
}
But we can be more verbose for greater control
module.exports = {
root: {
src: './app/assets',
dest: './public/assets'
},
tasks: {
js: {
// with our `root`, this means take stuff from ./app/assets/javascripts
src: 'javascripts',
// and output it to ./public/assets
dest: '.',
// this will create a `shared.js` file of common code, to keep multiple files small
extractSharedJs: true,
// take a.js and b.js, and compile it to bundle.js
entries: {
bundle: ['./a.js', './b.js']
},
// since we have locally `npm install jquery`d, we can set it up as a global
globals: {
jquery: ['