Last active
August 29, 2015 13:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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