https://github.com/stipsan/gulp-purge-sourcemaps
Cleans up after gulp-sourcemaps have done a sourcemaps.write() allowing you to combine streams that generate both dev assets with sourcemaps and minified production assets.
https://github.com/stipsan/gulp-purge-sourcemaps
Last synced: 12 months ago
JSON representation
Cleans up after gulp-sourcemaps have done a sourcemaps.write() allowing you to combine streams that generate both dev assets with sourcemaps and minified production assets.
- Host: GitHub
- URL: https://github.com/stipsan/gulp-purge-sourcemaps
- Owner: stipsan
- Created: 2015-11-10T12:30:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:25:45.000Z (over 2 years ago)
- Last Synced: 2025-06-06T16:16:46.328Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [gulp](http://gulpjs.com)-purge-sourcemaps
> Cleans up after gulp-sourcemaps have done a sourcemaps.write() allowing you to combine streams that generate both dev assets with sourcemaps and minified production assets.
[](https://www.npmjs.com/package/gulp-purge-sourcemaps)
[](https://nodei.co/npm/gulp-purge-sourcemaps/)
## Install
```
npm install --save-dev gulp-purge-sourcemaps
```
## Example
```js
var gulp = require('gulp');
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var minifyCSS = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps');
var purgeSourcemaps = require('gulp-purge-sourcemaps');
gulp.task('default', function () {
gulp.src('app.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'))
.pipe(purgeSourcemaps(/* sourcemaps.write() has been called, minifyCSS should not be fooled into thinking it's not generated yet */))
.pipe(minifyCSS({keepSpecialComments:0, processImport: false}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
});
```
## License
MIT