Comparing version 4.5.0 to 4.5.1
# Changelog | ||
## 4.5.1 | ||
- Adds PostCSS support | ||
- Autoprefixer replaces gulp-autoprefixer | ||
- cssnano replaces gulp-cssnano | ||
Users can configure `plugins` and `options` in `task-config.js`'s `stylesheets.postcss`. See [gulp-postcss](https://github.com/postcss/gulp-postcss) for more info. | ||
Basic usage is unchanged. Source stylesheets will be preprocessed with Sass unless `stylesheets.sass` is `false`. You can still call out Sass explicitly if you like: | ||
```javascript | ||
// in task-config.js | ||
stylesheets: true | ||
``` | ||
A `task-config` with custom PostCSS will look like this | ||
```javascript | ||
// task-config.js | ||
// must also add the dependencies (`(npm i|yarn add) some-plugin some-option`) | ||
var somePlugin = require('some-plugin') | ||
var someOption = require('some-option') | ||
var postCssPlugins = [somePlugin()] | ||
var postCssOptions = {someOption} | ||
module.exports = { | ||
// ... | ||
stylesheets: { | ||
// sass: true is implied | ||
postcss: { | ||
plugins: postCssPlugins, | ||
options: postCssOptions | ||
} | ||
} | ||
// ... | ||
} | ||
``` | ||
Autoprefixer and cssnano are injected into the PostCSS plugins list, and do not need to be specified. However custom Autoprefixer and/or cssnano configs are respected if provided. That looks like this: | ||
```javascript | ||
// task-config.js | ||
// must also add the autoprefixer dependency (`(npm i|yarn add) autoprefixer`) | ||
var autoprefixer = require('autoprefixer') | ||
var postCssPlugins = [ | ||
autoprefixer({ | ||
grid: "autoplace" | ||
}) | ||
] | ||
module.exports = { | ||
// ... | ||
stylesheets: { | ||
// sass: true is implied | ||
postcss: { | ||
plugins: postCssPlugins | ||
} | ||
} | ||
// ... | ||
} | ||
``` | ||
## 4.5.0 | ||
@@ -4,0 +72,0 @@ Recommended security-focused upgrade: |
@@ -43,3 +43,13 @@ const os = require('os') | ||
}, | ||
extensions: ["sass", "scss", "css"] | ||
extensions: ["sass", "scss", "css", "pcss"], | ||
cssnano: { | ||
// deprecated. configure cssnano in stylesheets.postcss.plugins | ||
}, | ||
postcss: { | ||
plugins: [ | ||
// Autoprefixer and cssnano are added automatically, | ||
// with default settings, if not given custom configuration here | ||
], | ||
options: {} | ||
} | ||
}, | ||
@@ -46,0 +56,0 @@ |
if(!TASK_CONFIG.stylesheets) return | ||
var gulp = require('gulp') | ||
var gulpif = require('gulp-if') | ||
var browserSync = require('browser-sync') | ||
var sass = require('gulp-sass') | ||
var sourcemaps = require('gulp-sourcemaps') | ||
var handleErrors = require('../lib/handleErrors') | ||
var autoprefixer = require('gulp-autoprefixer') | ||
var projectPath = require('../lib/projectPath') | ||
var cssnano = require('gulp-cssnano') | ||
var gulp = require('gulp') | ||
var addPostCssPlugin = require('../lib/addPostCssPlugin') | ||
var autoprefixer = require('autoprefixer') | ||
var browserSync = require('browser-sync') | ||
var cssnano = require('cssnano') | ||
var gulpif = require('gulp-if') | ||
var handleErrors = require('../lib/handleErrors') | ||
var postcss = require('gulp-postcss') | ||
var projectPath = require('../lib/projectPath') | ||
var sass = require('gulp-sass') | ||
var sourcemaps = require('gulp-sourcemaps') | ||
@@ -20,3 +22,3 @@ var sassTask = function () { | ||
if(TASK_CONFIG.stylesheets.sass && TASK_CONFIG.stylesheets.sass.includePaths) { | ||
if (TASK_CONFIG.stylesheets.sass && TASK_CONFIG.stylesheets.sass.includePaths) { | ||
TASK_CONFIG.stylesheets.sass.includePaths = TASK_CONFIG.stylesheets.sass.includePaths.map(function(includePath) { | ||
@@ -27,11 +29,31 @@ return projectPath(includePath) | ||
var cssnanoConfig = TASK_CONFIG.stylesheets.cssnano || {} | ||
cssnanoConfig.autoprefixer = false // this should always be false, since we're autoprefixing separately | ||
TASK_CONFIG.stylesheets.autoprefixer = TASK_CONFIG.stylesheets.autoprefixer || {} | ||
TASK_CONFIG.stylesheets.cssnano = TASK_CONFIG.stylesheets.cssnano || {} | ||
TASK_CONFIG.stylesheets.cssnano.autoprefixer = false // this should always be false, since we're autoprefixing separately | ||
TASK_CONFIG.stylesheets.postcss.options = TASK_CONFIG.stylesheets.postcss.options || {} | ||
TASK_CONFIG.stylesheets.postcss.plugins = TASK_CONFIG.stylesheets.postcss.plugins || [] | ||
var preprocess = !!TASK_CONFIG.stylesheets.sass | ||
// when watching files, only run once | ||
if (!TASK_CONFIG.stylesheets.configured) { | ||
// ensure Autoprefixer is in the PostCSS config | ||
addPostCssPlugin('autoprefixer', autoprefixer(TASK_CONFIG.stylesheets.autoprefixer)) | ||
if (global.production) { | ||
// ensure cssnano is in the PostCSS config | ||
addPostCssPlugin('cssnano', cssnano(TASK_CONFIG.stylesheets.cssnano)) | ||
} | ||
} | ||
TASK_CONFIG.stylesheets.configured = true | ||
return gulp.src(paths.src) | ||
.pipe(gulpif(!global.production, sourcemaps.init())) | ||
.pipe(sass(TASK_CONFIG.stylesheets.sass)) | ||
.pipe(gulpif(preprocess, sass(TASK_CONFIG.stylesheets.sass))) | ||
.on('error', handleErrors) | ||
.pipe(autoprefixer(TASK_CONFIG.stylesheets.autoprefixer)) | ||
.pipe(gulpif(global.production, cssnano(cssnanoConfig))) | ||
.pipe(postcss(TASK_CONFIG.stylesheets.postcss.plugins, TASK_CONFIG.stylesheets.postcss.options)) | ||
.on('error', handleErrors) | ||
.pipe(gulpif(!global.production, sourcemaps.write())) | ||
@@ -38,0 +60,0 @@ .pipe(gulp.dest(paths.dest)) |
{ | ||
"name": "blendid", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"description": "A full featured configurable asset pipeline and static site builder", | ||
@@ -28,2 +28,3 @@ "license": "MIT", | ||
"ansi-colors": "^3.2.4", | ||
"autoprefixer": "^9.6.0", | ||
"babel-core": "^6.26.3", | ||
@@ -34,2 +35,3 @@ "babel-loader": "^7.1.1", | ||
"browser-sync": "^2.26.3", | ||
"cssnano": "^4.1.10", | ||
"del": "4.0.0", | ||
@@ -39,5 +41,3 @@ "es6-promise": "^4.2.6", | ||
"gulp": "3.9.1", | ||
"gulp-autoprefixer": "6.0.0", | ||
"gulp-changed": "^3.2.0", | ||
"gulp-cssnano": "2.1.3", | ||
"gulp-data": "1.3.1", | ||
@@ -49,3 +49,4 @@ "gulp-gh-pages": "0.5.4", | ||
"gulp-nunjucks-render": "^2.2.2", | ||
"gulp-rename": "1.4.0", | ||
"gulp-postcss": "^8.0.0", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-replace": "^1.0.0", | ||
@@ -52,0 +53,0 @@ "gulp-rev": "9.0.0", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1487
1
135861
42
+ Addedautoprefixer@^9.6.0
+ Addedcssnano@^4.1.10
+ Addedgulp-postcss@^8.0.0
+ Added@types/q@1.5.8(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedcaller-callsite@2.0.0(transitive)
+ Addedcaller-path@2.0.0(transitive)
+ Addedcallsites@2.0.0(transitive)
+ Addedcaniuse-api@3.0.0(transitive)
+ Addedcoa@2.0.2(transitive)
+ Addedcolor@3.2.1(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedcosmiconfig@5.2.1(transitive)
+ Addedcss-declaration-sorter@4.0.1(transitive)
+ Addedcss-select@2.1.0(transitive)
+ Addedcss-select-base-adapter@0.1.1(transitive)
+ Addedcss-tree@1.0.0-alpha.371.1.3(transitive)
+ Addedcss-what@3.4.2(transitive)
+ Addedcssesc@3.0.0(transitive)
+ Addedcssnano@4.1.11(transitive)
+ Addedcssnano-preset-default@4.0.8(transitive)
+ Addedcssnano-util-get-arguments@4.0.0(transitive)
+ Addedcssnano-util-get-match@4.0.0(transitive)
+ Addedcssnano-util-raw-cache@4.0.1(transitive)
+ Addedcssnano-util-same-parent@4.0.1(transitive)
+ Addedcsso@4.2.0(transitive)
+ Addeddomutils@1.7.0(transitive)
+ Addeddot-prop@5.3.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedes-abstract@1.23.9(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedgulp-postcss@8.0.0(transitive)
+ Addedhex-color-regex@1.1.0(transitive)
+ Addedhsl-regex@1.0.0(transitive)
+ Addedhsla-regex@1.0.0(transitive)
+ Addedimport-cwd@2.1.0(transitive)
+ Addedimport-fresh@2.0.0(transitive)
+ Addedimport-from@2.1.0(transitive)
+ Addedis-arrayish@0.2.10.3.2(transitive)
+ Addedis-color-stop@1.1.0(transitive)
+ Addedis-directory@0.3.1(transitive)
+ Addedis-obj@2.0.0(transitive)
+ Addedis-resolvable@1.1.0(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedmdn-data@2.0.142.0.4(transitive)
+ Addednormalize-url@3.3.0(transitive)
+ Addedobject.getownpropertydescriptors@2.1.8(transitive)
+ Addedobject.values@1.2.1(transitive)
+ Addedparse-json@4.0.0(transitive)
+ Addedpostcss-calc@7.0.5(transitive)
+ Addedpostcss-colormin@4.0.3(transitive)
+ Addedpostcss-convert-values@4.0.1(transitive)
+ Addedpostcss-discard-comments@4.0.2(transitive)
+ Addedpostcss-discard-duplicates@4.0.2(transitive)
+ Addedpostcss-discard-empty@4.0.1(transitive)
+ Addedpostcss-discard-overridden@4.0.1(transitive)
+ Addedpostcss-load-config@2.1.2(transitive)
+ Addedpostcss-merge-longhand@4.0.11(transitive)
+ Addedpostcss-merge-rules@4.0.3(transitive)
+ Addedpostcss-minify-font-values@4.0.2(transitive)
+ Addedpostcss-minify-gradients@4.0.2(transitive)
+ Addedpostcss-minify-params@4.0.2(transitive)
+ Addedpostcss-minify-selectors@4.0.2(transitive)
+ Addedpostcss-normalize-charset@4.0.1(transitive)
+ Addedpostcss-normalize-display-values@4.0.2(transitive)
+ Addedpostcss-normalize-positions@4.0.2(transitive)
+ Addedpostcss-normalize-repeat-style@4.0.2(transitive)
+ Addedpostcss-normalize-string@4.0.2(transitive)
+ Addedpostcss-normalize-timing-functions@4.0.2(transitive)
+ Addedpostcss-normalize-unicode@4.0.1(transitive)
+ Addedpostcss-normalize-url@4.0.1(transitive)
+ Addedpostcss-normalize-whitespace@4.0.2(transitive)
+ Addedpostcss-ordered-values@4.1.2(transitive)
+ Addedpostcss-reduce-initial@4.0.3(transitive)
+ Addedpostcss-reduce-transforms@4.0.2(transitive)
+ Addedpostcss-selector-parser@3.1.26.1.2(transitive)
+ Addedpostcss-svgo@4.0.3(transitive)
+ Addedpostcss-unique-selectors@4.0.1(transitive)
+ Addedq@1.5.1(transitive)
+ Addedresolve-from@3.0.0(transitive)
+ Addedrgb-regex@1.0.1(transitive)
+ Addedrgba-regex@1.0.0(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedstable@0.1.8(transitive)
+ Addedstylehacks@4.0.3(transitive)
+ Addedsvgo@1.3.2(transitive)
+ Addedtimsort@0.3.0(transitive)
+ Addedunquote@1.1.1(transitive)
+ Addedutil.promisify@1.0.1(transitive)
- Removedgulp-autoprefixer@6.0.0
- Removedgulp-cssnano@2.1.3
- Removedasn1.js@4.10.1(transitive)
- Removedautoprefixer@6.7.7(transitive)
- Removedbalanced-match@0.4.2(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowserslist@1.7.7(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcaniuse-api@1.6.1(transitive)
- Removedcaniuse-db@1.0.30001696(transitive)
- Removedcenter-align@0.1.3(transitive)
- Removedcoa@1.0.4(transitive)
- Removedcolor@0.11.4(transitive)
- Removedcolormin@1.1.2(transitive)
- Removedcolors@1.1.2(transitive)
- Removedcssnano@3.10.0(transitive)
- Removedcsso@2.3.2(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddes.js@1.1.0(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedflatten@1.0.3(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedgulp-autoprefixer@6.0.0(transitive)
- Removedgulp-cssnano@2.1.3(transitive)
- Removedhas-flag@1.0.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedhtml-comment-regex@1.1.2(transitive)
- Removedis-svg@2.1.0(transitive)
- Removedjs-yaml@3.7.0(transitive)
- Removedmath-expression-evaluator@1.4.0(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removednormalize-url@1.9.1(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpostcss@5.2.18(transitive)
- Removedpostcss-calc@5.3.1(transitive)
- Removedpostcss-colormin@2.2.2(transitive)
- Removedpostcss-convert-values@2.6.1(transitive)
- Removedpostcss-discard-comments@2.0.4(transitive)
- Removedpostcss-discard-duplicates@2.1.0(transitive)
- Removedpostcss-discard-empty@2.1.0(transitive)
- Removedpostcss-discard-overridden@0.1.1(transitive)
- Removedpostcss-discard-unused@2.2.3(transitive)
- Removedpostcss-filter-plugins@2.0.3(transitive)
- Removedpostcss-merge-idents@2.1.7(transitive)
- Removedpostcss-merge-longhand@2.0.2(transitive)
- Removedpostcss-merge-rules@2.1.2(transitive)
- Removedpostcss-message-helpers@2.0.0(transitive)
- Removedpostcss-minify-font-values@1.0.5(transitive)
- Removedpostcss-minify-gradients@1.0.5(transitive)
- Removedpostcss-minify-params@1.2.2(transitive)
- Removedpostcss-minify-selectors@2.1.1(transitive)
- Removedpostcss-normalize-charset@1.1.1(transitive)
- Removedpostcss-normalize-url@3.0.8(transitive)
- Removedpostcss-ordered-values@2.2.3(transitive)
- Removedpostcss-reduce-idents@2.4.0(transitive)
- Removedpostcss-reduce-initial@1.0.1(transitive)
- Removedpostcss-reduce-transforms@1.0.4(transitive)
- Removedpostcss-selector-parser@2.2.3(transitive)
- Removedpostcss-svgo@2.1.6(transitive)
- Removedpostcss-unique-selectors@2.0.2(transitive)
- Removedpostcss-zindex@2.2.0(transitive)
- Removedprepend-http@1.0.4(transitive)
- Removedquery-string@4.3.4(transitive)
- Removedreduce-css-calc@1.3.0(transitive)
- Removedreduce-function-call@1.0.3(transitive)
- Removedright-align@0.1.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedsort-keys@1.1.2(transitive)
- Removedsupports-color@3.2.3(transitive)
- Removedsvgo@0.7.2(transitive)
- Removedwhet.extend@0.9.9(transitive)
Updatedgulp-rename@^1.4.0