Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcemaps with Uglify, Ng-Annotate, and Concat: Not pointing to the right location or file! #182

Open
gwetch opened this issue May 3, 2016 · 1 comment

Comments

@gwetch
Copy link

gwetch commented May 3, 2016

Using Gulp. I have been working on getting a sourcemap to work properly for debugging purposes in development without much luck. Any tips would be much appreciated, I have spent many hours rearranging and organizing my code yet nothing will help it. It will point to the end of the code on the last file in the list instead of showing where the actual issue is.

@gwetch
Copy link
Author

gwetch commented May 3, 2016

var gulp = require('gulp'),
    sass = require('gulp-sass'),
    prefix = require('gulp-autoprefixer'),
    concat = require('gulp-concat'),
    jshint = require('gulp-jshint'),
    del = require('del'),
    nodemon = require('gulp-nodemon'),
    sourcemaps = require('gulp-sourcemaps'),
    uglify = require('gulp-uglify'),
    ngAnnotate = require('gulp-ng-annotate')

gulp.task('js', function(){
    return gulp.src('./assets/js/**/*.js')
    .pipe(jshint('.jshintrc'))
    .pipe(jshint.reporter('default'))
    .pipe(sourcemaps.init({identityMap: true}))
    .pipe(ngAnnotate())
    .pipe(concat('scripts.js'))
    .pipe(uglify())
    .pipe(sourcemaps.write('./', {sourceMappingURLPrefix: './maps/js', includeContent: false, sourceRoot: './assets/js/**/*.js'}))
    .pipe(gulp.dest('./views/dist/js'))
})

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

No branches or pull requests

2 participants