Update NPM Dependencies, replace csswring by cssnano

This commit is contained in:
Stéphane Goetz 2015-12-22 21:52:22 +01:00
parent 1d29ea966b
commit 5997820360
8 changed files with 26 additions and 16 deletions

View File

@ -96,7 +96,7 @@ function removeUnusedRules(rules) {
var regexes = prepare_rules(rules);
return function(css) {
css.eachRule(function (rule) {
css.walkRules(function (rule) {
var removedSome = false,
selectors = rule.selectors,
i;
@ -111,7 +111,7 @@ function removeUnusedRules(rules) {
if(removedSome) {
if (selectors.length == 0) {
rule.removeSelf();
rule.remove();
} else {
rule.selectors = selectors;
}
@ -126,13 +126,21 @@ function removeUnusedRules(rules) {
function createTask(source, dest) {
return function() {
var nano_options = {
safe: true, // Disable dangerous optimisations
filterPlugins: false, // This does very weird stuff
autoprefixer: {
add: true, // Add needed prefixes
remove: true // Remove unnecessary prefixes
}
};
return gulp.src(source)
.pipe(plumber())
.pipe(less())
.pipe(postcss([
removeUnusedRules(unusedRules),
require('csswring')({
preserveHacks: true
})
require('cssnano')(nano_options)
]))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(dest));

View File

@ -3,14 +3,14 @@
"version": "0.1.1",
"private": true,
"devDependencies": {
"grunt": "~0.4.1",
"grunt-php": "~0.3.0",
"csswring": "^3.0.5",
"grunt": "^0.4.1",
"grunt-php": "^1.0.0",
"cssnano": "^3.4.0",
"gulp": "^3.9.0",
"gulp-connect-php": "0.0.5",
"gulp-connect-php": "^0.0.5",
"gulp-less": "^3.0.3",
"gulp-plumber": "^1.0.1",
"gulp-postcss": "^5.1.10",
"gulp-postcss": "^6.0.0",
"gulp-rename": "^1.2.2"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long