Skip to content

Commit

Permalink
Fix for sourcemap file locations
Browse files Browse the repository at this point in the history
babel-loader was setting `options.sourceFileName` to a relative path,
but this does not seem to work correctly anymore with either webpack or
babel itself and causes incorrect source map file data in webpack.

Setting it to an absolute path seems to fix the problem.

Fixes babel#480 and possibly also babel#93.
  • Loading branch information
chrisnicola committed Jun 26, 2017
1 parent d249119 commit 6d0e9ed
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 53 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"nyc": {
"all": true,
"include": [
"src/**/*.js"
"lib/**/*.js"
],
"reporter": [
"text",
Expand Down
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const loaderUtils = require("loader-utils");
const path = require("path");
const cache = require("./fs-cache.js");
const exists = require("./utils/exists");
const relative = require("./utils/relative");
const read = require("./utils/read");
const resolveRc = require("./resolve-rc.js");
const pkg = require("../package.json");
Expand Down Expand Up @@ -143,7 +142,7 @@ module.exports = function(source, inputSourceMap) {
}

if (options.sourceFileName === undefined) {
options.sourceFileName = relative(options.sourceRoot, options.filename);
options.sourceFileName = options.filename;
}

const cacheDirectory = options.cacheDirectory;
Expand Down
13 changes: 0 additions & 13 deletions src/utils/relative.js

This file was deleted.

37 changes: 0 additions & 37 deletions test/utils/relative.test.js

This file was deleted.

0 comments on commit 6d0e9ed

Please sign in to comment.