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

Feature request: Sourcemaps support #49

Closed
jpzwarte opened this issue Jul 17, 2014 · 14 comments
Closed

Feature request: Sourcemaps support #49

jpzwarte opened this issue Jul 17, 2014 · 14 comments

Comments

@jpzwarte
Copy link

ng-annotate lacks support for (inline) sourcemaps. Pointed here from gulp-ng-annotate: Kagami/gulp-ng-annotate#3

Nicest solution would be to update inline sourcemaps similar to autoprefixer: https://github.com/ai/autoprefixer#source-map ?

@olov
Copy link
Owner

olov commented Jul 17, 2014

Yup. I will be happy merge a source maps PR!

@olov olov closed this as completed Jul 17, 2014
@olov olov reopened this Jul 19, 2014
@olov olov mentioned this issue Jul 19, 2014
@olov olov changed the title Sourcemaps support Feature request: Sourcemaps support Jul 19, 2014
@efolio
Copy link

efolio commented Jul 22, 2014

👍 Need! 

@qraynaud
Copy link

👍

@smrq
Copy link
Contributor

smrq commented Jul 25, 2014

I have a mostly working implementation for basic sourcemaps. (No merging of existing sourcemaps, at least for now. gulp-ng-annotate should be able to handle that at least) I'll try and clean it up for a PR!

@olov
Copy link
Owner

olov commented Aug 2, 2014

Merged and will be part of 0.9.9

@olov olov closed this as completed Aug 2, 2014
@Kagami
Copy link

Kagami commented Aug 2, 2014

👍

@olov
Copy link
Owner

olov commented Aug 2, 2014

0.9.9 is released

@jpzwarte
Copy link
Author

jpzwarte commented Aug 3, 2014

Thanks!

@johnpapa
Copy link

johnpapa commented Aug 3, 2014

Does this support sourcemaps created using gulp/grunt where we concat, ngannotate, and uglify and add sourcemaps? I'm seeing the line numbers being off in chrome.

@mgol
Copy link

mgol commented Aug 4, 2014

@johnpapa No, AFAIK it doesn't consume input source maps for now.

@olov
Copy link
Owner

olov commented Aug 4, 2014

Re incorrect line numbers, can you please open an issue with test data?

I will merge further improvements to source maps, especially input support. Keep those PR's coming! =)

@luckylooke
Copy link

Same as @johnpapa.
My use:
gulp.task('scripts', function() {
return gulp.src(['src/*/.js'])
.pipe(jshint('.jshintrc'))
.pipe(sourcemaps.init())
.pipe(concat('main.js'))
.pipe(ngAnotate())
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist/scripts'));
});

ngAnotate = require('gulp-ng-annotate'),
uglify = require('gulp-uglify'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
sourcemaps = require('gulp-sourcemaps');

chrome developer tools points me to different file and place in it :/

Without ng-annotate it works correctly! :/

@smrq
Copy link
Contributor

smrq commented Aug 4, 2014

I'm currently looking into this. I think it has something to do with the file and/or sources properties of the incoming and/or generated sourcemaps. gulp-ng-annotate uses vinyl-sourcemaps-apply which uses SourceMapGenerator.prototype.applySourceMap from source-map. That relies on filenames to do the correct mappings, which potentially gets tricky with a gulp-based workflow because there aren't real intermediate files.

You can see what's going on with your particular files by visualizing the sourcemap output using this tool: http://sokra.github.io/source-map-visualization/

@b-long
Copy link

b-long commented Sep 8, 2014

Is anyone using Kagami/gulp-ng-annotate ? If so, would you mind sharing an example Gulpfile & package.json?

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

10 participants