Skip to content

Fix sourcemaps when chaining loaders #5

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

Merged
merged 1 commit into from
Jul 2, 2015
Merged

Fix sourcemaps when chaining loaders #5

merged 1 commit into from
Jul 2, 2015

Conversation

mattlewis92
Copy link
Contributor

The sourcemaps are passed the wrong way round which breaks them when using previous loaders. For example:

Sample es6

import angular from 'angular';
var app = angular.module('myApp', []);

function testFactory($location) {
    'ngInject'; 
}

app.factory('test', testFactory);

app.run(function($http) {
    throw new Error('test');
});

Sample webpack config

module.exports = {
    entry: "./index",
        output: {
            path: __dirname + "/dist",
            filename: "bundle.js"
        },
    module: {
      loaders: [
        {
          test: /\.js?$/,
          exclude: /(node_modules|bower_components)/,
          loaders: ['ng-annotate', 'babel?optional[]=es7.decorators&optional[]=runtime']
        }
      ]
    },
    devtool: 'source-map'
};

If you run that in your browser you get this:
screen shot 2015-07-02 at 00 18 08

andrey-skl added a commit that referenced this pull request Jul 2, 2015
Fix sourcemaps when chaining loaders
@andrey-skl andrey-skl merged commit 1121de4 into andrey-skl:master Jul 2, 2015
@andrey-skl
Copy link
Owner

Causes #6

andrey-skl added a commit that referenced this pull request Jul 8, 2015
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.

2 participants