Move autoprefixer and purifyCss settings

This commit is contained in:
Oliver Davies 2017-08-03 01:32:37 +01:00
parent f7dee6b6f2
commit 2c4f8036c2
2 changed files with 11 additions and 9 deletions

View file

@ -5,16 +5,9 @@ module.exports = function (gulp, plugins, config, sourceFiles, outputFile) {
.pipe(plugins.if(!config.production, plugins.sourcemaps.init()))
.pipe(plugins.sassGlob())
.pipe(plugins.sass())
.pipe(plugins.autoprefixer({
browsers: ["last 2 versions", "> 5%"],
cascade: false
}))
.pipe(plugins.autoprefixer(config.sass.autoprefixer))
.pipe(plugins.concat(outputFile))
.pipe(plugins.if(config.production, plugins.purifycss([
'source/**/*.html',
'source/**/*.md',
'source/**/*.twig',
])))
.pipe(plugins.if(config.production, plugins.purifycss(config.sass.purifyCss)))
.pipe(plugins.if(config.production, plugins.cleanCss()))
.pipe(plugins.if(!config.production, plugins.sourcemaps.write('.')))
.pipe(plugins.if(!config.production, plugins.refresh()))

View file

@ -1,8 +1,17 @@
module.exports = function (plugins) {
return {
sass: {
autoprefixer: {
browsers: ["last 2 versions", "> 5%"],
cascade: false
},
sourceDir: "assets/sass",
pattern: "/**/*.sass",
purifyCss: [
'source/**/*.html',
'source/**/*.md',
'source/**/*.twig'
],
outputDir: "source/assets/css"
},
fonts: {