vesparny / angular-kickstart

angular-kickstart - speed up your AngularJS development and testing with a great gulpjs build system.
http://bit.ly/angular_kickstart
MIT License
552 stars 83 forks source link

sourcemaps / useref / gulp #31

Closed pixedd closed 6 years ago

pixedd commented 7 years ago

Hi There ! Thanks for your work :) !

I've got an issue when generating my build files, the sourcemaps doesn't match the correct .map when error is displayed, I'm working with angular 1.5 and used your starter-kit as a base :)


gulp.task('html', function() {

  return gulp.src(config.index)
    .pipe(useref({searchPath: 'public'}, lazypipe().pipe(sourcemaps.init, {largeFile: true, loadMaps: false })))
    .pipe(gulpif('**/*main.js', ngAnnotate()))
    .pipe(gulpif('*.js', uglify({
      mangle: false,
      output: {
        max_line_len: 80000
      }
    })))
    .pipe(gulpif('*.css', $.csso()))
    .pipe(gulpif(['**/*main.js', '**/*main.css'], $.header(config.banner, {
      pkg: pkg
    })))
    .pipe(sourcemaps.write('.'))
    .pipe(gulpif(/\.css|\.js$/, rev()))
    .pipe($.revReplace({replaceInExtensions:['.php']}))
    .pipe(gulp.dest(function(file) {
      console.log(file.relative);
      if (file.relative=='index.php') {
        return config.dist_index;

      } else if (file.relative.indexOf(config.dist)) {
        return config.base;
      }
      return config.dist;
    }));

});```

The sourcemaps is correctly generated, however when an error occurs the line / file is not correct in the sourcemaps.

Do you have an idea ?
vesparny commented 7 years ago

Hi, sorry but it's been a while I haven't used this project.