Update NPM Dependencies, replace csswring by cssnano
This commit is contained in:
parent
1d29ea966b
commit
5997820360
18
gulpfile.js
18
gulpfile.js
@ -96,7 +96,7 @@ function removeUnusedRules(rules) {
|
|||||||
var regexes = prepare_rules(rules);
|
var regexes = prepare_rules(rules);
|
||||||
|
|
||||||
return function(css) {
|
return function(css) {
|
||||||
css.eachRule(function (rule) {
|
css.walkRules(function (rule) {
|
||||||
var removedSome = false,
|
var removedSome = false,
|
||||||
selectors = rule.selectors,
|
selectors = rule.selectors,
|
||||||
i;
|
i;
|
||||||
@ -111,7 +111,7 @@ function removeUnusedRules(rules) {
|
|||||||
|
|
||||||
if(removedSome) {
|
if(removedSome) {
|
||||||
if (selectors.length == 0) {
|
if (selectors.length == 0) {
|
||||||
rule.removeSelf();
|
rule.remove();
|
||||||
} else {
|
} else {
|
||||||
rule.selectors = selectors;
|
rule.selectors = selectors;
|
||||||
}
|
}
|
||||||
@ -126,13 +126,21 @@ function removeUnusedRules(rules) {
|
|||||||
|
|
||||||
function createTask(source, dest) {
|
function createTask(source, dest) {
|
||||||
return function() {
|
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)
|
return gulp.src(source)
|
||||||
|
.pipe(plumber())
|
||||||
.pipe(less())
|
.pipe(less())
|
||||||
.pipe(postcss([
|
.pipe(postcss([
|
||||||
removeUnusedRules(unusedRules),
|
removeUnusedRules(unusedRules),
|
||||||
require('csswring')({
|
require('cssnano')(nano_options)
|
||||||
preserveHacks: true
|
|
||||||
})
|
|
||||||
]))
|
]))
|
||||||
.pipe(rename({suffix: '.min'}))
|
.pipe(rename({suffix: '.min'}))
|
||||||
.pipe(gulp.dest(dest));
|
.pipe(gulp.dest(dest));
|
||||||
|
10
package.json
10
package.json
@ -3,14 +3,14 @@
|
|||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.1",
|
"grunt": "^0.4.1",
|
||||||
"grunt-php": "~0.3.0",
|
"grunt-php": "^1.0.0",
|
||||||
"csswring": "^3.0.5",
|
"cssnano": "^3.4.0",
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
"gulp-connect-php": "0.0.5",
|
"gulp-connect-php": "^0.0.5",
|
||||||
"gulp-less": "^3.0.3",
|
"gulp-less": "^3.0.3",
|
||||||
"gulp-plumber": "^1.0.1",
|
"gulp-plumber": "^1.0.1",
|
||||||
"gulp-postcss": "^5.1.10",
|
"gulp-postcss": "^6.0.0",
|
||||||
"gulp-rename": "^1.2.2"
|
"gulp-rename": "^1.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
themes/daux/css/theme-blue.min.css
vendored
2
themes/daux/css/theme-blue.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-green.min.css
vendored
2
themes/daux/css/theme-green.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-navy.min.css
vendored
2
themes/daux/css/theme-navy.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-red.min.css
vendored
2
themes/daux/css/theme-red.min.css
vendored
File diff suppressed because one or more lines are too long
4
themes/daux/css/theme.min.css
vendored
4
themes/daux/css/theme.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux_singlepage/css/main.min.css
vendored
2
themes/daux_singlepage/css/main.min.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user