Browse Source

Purify doesnt seem to work as expected??

purify
jlukic 9 years ago
parent
commit
6ea6051af5
5 changed files with 14 additions and 0 deletions
  1. 2
      package.json
  2. 1
      semantic.json.example
  3. 4
      tasks/build/css.js
  4. 3
      tasks/config/defaults.js
  5. 4
      tasks/watch.js

2
package.json

@ -36,6 +36,7 @@
"gulp-notify": "*",
"gulp-plumber": "*",
"gulp-print": "*",
"gulp-purifycss": "*",
"gulp-rename": "*",
"gulp-replace": "*",
"gulp-rtlcss": "*",
@ -68,6 +69,7 @@
"gulp-plumber": "^1.0.1",
"gulp-print": "^1.1.0",
"gulp-prompt": "^0.1.2",
"gulp-purifycss": "^0.2.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.3",
"gulp-rtlcss": "^0.1.4",

1
semantic.json.example

@ -2,6 +2,7 @@
"base": "",
"paths": {
"purify": false,
"source": {
"config" : "src/theme.config",
"definitions" : "src/definitions/",

4
tasks/build/css.js

@ -19,6 +19,7 @@ var
minifyCSS = require('gulp-minify-css'),
plumber = require('gulp-plumber'),
print = require('gulp-print'),
purifyCSS = require('gulp-purifycss'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
@ -57,10 +58,13 @@ module.exports = function(callback) {
return;
}
console.log(config.purify);
// unified css stream
stream = gulp.src(source.definitions + '/**/' + globs.components + '.less')
.pipe(plumber(settings.plumber.less))
.pipe(less(settings.less))
.pipe(gulpif(config.purify, purifyCSS(config.purify)))
.pipe(autoprefixer(settings.prefix))
.pipe(replace(comments.variables.in, comments.variables.out))
.pipe(replace(comments.license.in, comments.license.out))

3
tasks/config/defaults.js

@ -23,6 +23,9 @@ module.exports = {
theme : 'src/theme.config'
},
// Array of paths to run purify-css against
purify: false,
// folder paths
paths: {
source: {

4
tasks/watch.js

@ -19,6 +19,7 @@ var
plumber = require('gulp-plumber'),
print = require('gulp-print'),
rename = require('gulp-rename'),
purifyCSS = require('gulp-purifycss'),
replace = require('gulp-replace'),
uglify = require('gulp-uglify'),
util = require('gulp-util'),
@ -138,6 +139,8 @@ module.exports = function(callback) {
if( fs.existsSync(lessPath) ) {
console.log(config.purify);
// unified css stream
stream = gulp.src(lessPath)
.pipe(plumber(settings.plumber.less))
@ -148,6 +151,7 @@ module.exports = function(callback) {
.pipe(replace(comments.large.in, comments.large.out))
.pipe(replace(comments.small.in, comments.small.out))
.pipe(replace(comments.tiny.in, comments.tiny.out))
.pipe(gulpif(config.purify, purifyCSS(config.purify)))
.pipe(autoprefixer(settings.prefix))
.pipe(gulpif(config.hasPermission, chmod(config.permission)))
;

Loading…
Cancel
Save