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);
|
||||
|
||||
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));
|
||||
|
10
package.json
10
package.json
@ -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"
|
||||
}
|
||||
}
|
||||
|
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