gulp-strip-css-comments
Advanced tools
+7
-7
| 'use strict'; | ||
| var gutil = require('gulp-util'); | ||
| var through = require('through2'); | ||
| var stripCssComments = require('strip-css-comments'); | ||
| const through = require('through2'); | ||
| const stripCssComments = require('strip-css-comments'); | ||
| const PluginError = require('plugin-error'); | ||
| module.exports = function (opts) { | ||
| module.exports = options => { | ||
| return through.obj(function (file, enc, cb) { | ||
@@ -13,3 +13,3 @@ if (file.isNull()) { | ||
| if (file.isStream()) { | ||
| cb(new gutil.PluginError('gulp-strip-css-comments', 'Streaming not supported')); | ||
| cb(new PluginError('gulp-strip-css-comments', 'Streaming not supported')); | ||
| return; | ||
@@ -19,6 +19,6 @@ } | ||
| try { | ||
| file.contents = new Buffer(stripCssComments(file.contents.toString(), opts)); | ||
| file.contents = Buffer.from(stripCssComments(file.contents.toString(), options)); | ||
| this.push(file); | ||
| } catch (err) { | ||
| this.emit('error', new gutil.PluginError('gulp-strip-css-comments', err, {fileName: file.path})); | ||
| this.emit('error', new PluginError('gulp-strip-css-comments', err, {fileName: file.path})); | ||
| } | ||
@@ -25,0 +25,0 @@ |
+43
-41
| { | ||
| "name": "gulp-strip-css-comments", | ||
| "version": "1.2.0", | ||
| "description": "Strip comments from CSS", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/gulp-strip-css-comments", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=0.10.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "node test.js" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "gulpplugin", | ||
| "css", | ||
| "style", | ||
| "stylesheet", | ||
| "strip", | ||
| "remove", | ||
| "delete", | ||
| "trim", | ||
| "comments", | ||
| "preprocess", | ||
| "transform", | ||
| "string" | ||
| ], | ||
| "dependencies": { | ||
| "gulp-util": "^3.0.0", | ||
| "strip-css-comments": "^3.0.0", | ||
| "through2": "^2.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "0.0.4" | ||
| } | ||
| "name": "gulp-strip-css-comments", | ||
| "version": "2.0.0", | ||
| "description": "Strip comments from CSS", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/gulp-strip-css-comments", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=4" | ||
| }, | ||
| "scripts": { | ||
| "test": "xo && ava" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "gulpplugin", | ||
| "css", | ||
| "style", | ||
| "stylesheet", | ||
| "strip", | ||
| "remove", | ||
| "delete", | ||
| "trim", | ||
| "comments", | ||
| "preprocess", | ||
| "transform", | ||
| "string" | ||
| ], | ||
| "dependencies": { | ||
| "plugin-error": "^0.1.2", | ||
| "strip-css-comments": "^3.0.0", | ||
| "through2": "^2.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "*", | ||
| "vinyl": "^2.1.0", | ||
| "xo": "^0.18.2" | ||
| } | ||
| } |
+7
-7
@@ -16,10 +16,10 @@ # gulp-strip-css-comments [](https://travis-ci.org/sindresorhus/gulp-strip-css-comments) | ||
| ```js | ||
| var gulp = require('gulp'); | ||
| var stripCssComments = require('gulp-strip-css-comments'); | ||
| const gulp = require('gulp'); | ||
| const stripCssComments = require('gulp-strip-css-comments'); | ||
| gulp.task('default', function () { | ||
| return gulp.src('src/app.css') | ||
| gulp.task('default', () => | ||
| gulp.src('src/app.css') | ||
| .pipe(stripCssComments()) | ||
| .pipe(gulp.dest('dist')); | ||
| }); | ||
| .pipe(gulp.dest('dist')) | ||
| ); | ||
| ``` | ||
@@ -37,2 +37,2 @@ | ||
| MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
| MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
3295
-1.55%3
200%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed