Skip to content

Conversation

@vmarkovtsev
Copy link
Contributor

This properly fixes #64; #96

E.g., now source maps are successfully generated with

var assets = plugins.useref.assets({},
    lazypipe().pipe(plugins.sourcemaps.init, {loadMaps: true}));
  return gulp.src('index.html')
    .pipe(assets)
    .pipe(plugins.if(['**/*.js', '!**/jquery.min.js'],
      plugins.uglify({ie_proof: false})))
    .pipe(plugins.if('*.css', lazypipe()
      .pipe(plugins.shorthand)
      .pipe(plugins.autoprefixer)
      .pipe(plugins.minifyCss,
      {roundingPrecision: -1, keepSpecialComments: 0})()))
    .pipe(plugins.sourcemaps.write('maps'))
    .pipe(assets.restore())
    .pipe(plugins.useref())
    .pipe(plugins.if('*.html', plugins.minifyHtml()))
    .pipe(gulp.dest(dist));

This properly fixes jonkemp#64; jonkemp#96

E.g., now source maps are successfully generated with
```js
var assets = plugins.useref.assets({},
    lazypipe().pipe(plugins.sourcemaps.init, {loadMaps: true}));
  return gulp.src('index.html')
    .pipe(assets)
    .pipe(plugins.if(['**/*.js', '!**/jquery.min.js'],
      plugins.uglify({ie_proof: false})))
    .pipe(plugins.if('*.css', lazypipe()
      .pipe(plugins.shorthand)
      .pipe(plugins.autoprefixer)
      .pipe(plugins.minifyCss,
      {roundingPrecision: -1, keepSpecialComments: 0})()))
    .pipe(plugins.sourcemaps.write('maps'))
    .pipe(assets.restore())
    .pipe(plugins.useref())
    .pipe(plugins.if('*.html', plugins.minifyHtml()))
    .pipe(gulp.dest(dist));
```
jonkemp added a commit that referenced this pull request Apr 7, 2015
@jonkemp jonkemp merged commit 0f8088e into jonkemp:master Apr 7, 2015
@jonkemp
Copy link
Owner

jonkemp commented Apr 7, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

please provide support for gulp-sourcemaps

3 participants