Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverJAsh/9781365 to your computer and use it in GitHub Desktop.
Save OliverJAsh/9781365 to your computer and use it in GitHub Desktop.
The Plumber equivalent of the Gruntfile from https://github.com/Mixd/frontend-framework
// https://github.com/plumberjs/plumber
var all = require('plumber-all');
var glob = require('plumber-glob');
var bower = require('plumber-bower');
var uglifyjs = require('plumber-uglifyjs')();
var concat = require('plumber-concat');
var filter = require('plumber-filter');
var mincss = require('plumber-mincss');
var rename = require('plumber-rename');
var write = require('plumber-write');
module.exports = function (pipelines) {
var modernizrConfig = {
extensibility: {
teststyles: true,
testprops: true,
prefixes: true,
domprefixes: true
},
parseFiles: ['src/scss/*.scss']
};
var autoprefixerConfig = {
browsers: ['last 2 version', 'ie 8', 'ie 9', 'Firefox ESR', 'Opera 12.1']
};
var sources = glob.within('./src')
/**
* TODO:
* - imageoptim
* - svgmin
* - grunticon
* - buildModernizr
* - compass
* - autoprefixer
*/
pipelines['build'] = [
glob('src/img/icons/**/*.svg'),
imageoptim,
svgmin,
grunticon,
// grunticon produces JS and CSS, so we branch
all(
[
filter.type('javascript'),
[
[
bower('modernizr'),
buildModernizr(modernizrConfig)
],
bower('jquery'),
sources('./js/**/*.js'),
],
// N.B: Concatenation and minification used to both be done by
// uglifyjs in the Gruntfile.
uglifyjs,
concat,
rename('bundle.js'),
write('./dist/js')
],
[
[
filter.type('css'),
[
sources('./scss/*.scss'),
compass,
autoprefixer(autoprefixerConfig)
]
],
mincss,
// N.B: These were not concatenated by the Gruntfile.
concat,
rename('bundle.css'),
write('./dist/css')
]
)
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment