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 not working with babel + ng-annotate #23

Open
killersite opened this issue Aug 2, 2016 · 2 comments
Open

Sourcemaps not working with babel + ng-annotate #23

killersite opened this issue Aug 2, 2016 · 2 comments

Comments

@killersite
Copy link

killersite commented Aug 2, 2016

module.exports = {
    devtool: 'sourcemap',
    context: __dirname + '/app',
    entry: './index.js',
    output: {
        filename: 'bundle.js'
    },
    module: {
        loaders: [
            // run babel first then ng-annotate
            { test: /\.js$/, loaders: ['ng-annotate','babel'] }
        ]
    }
};

When I use the above webpack config the source-map file is messed up with duplicate entries like the following.

"webpack:///./index.js",
"webpack:///./index.js?2645",
"webpack:///../~/angular/index.js",
"webpack:///../~/angular/index.js?08f2",
"webpack:///../~/angular/angular.js",
"webpack:///../~/angular/angular.js?58d0",

This is causing Chrome to not find the correct lines...

It seems that ng-annotate is inserting lines in the code without the source-map getting corrected info.

So where before ng-annotate (when the source-map was created) the code looked like

        /* @ngInject */
        function HeroController(users) {

now after ng-annotate there are new lines that the source-map doesnt know about

        /* @ngInject */
        HeroController.$inject = ["users"];
        function HeroController(users) {
@e-cloud
Copy link

e-cloud commented Aug 3, 2016

which version?

@killersite
Copy link
Author

"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"babel-core": "^6",
"babel-loader": "^6",
"ng-annotate-loader": "^0.1.1",
"webpack": "^1.12.13",

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

No branches or pull requests

2 participants