Skip to content

Commit 4d14079

Browse files
committed
Update resolving of filename
Also remove babelrc.js lookup as we do not support 7 in this version
1 parent d51e635 commit 4d14079

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ lib
44
node_modules
55
npm-debug.log
66
test/output
7+
yarn-error.log

src/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ function passMetadata(s, context, metadata) {
103103
}
104104

105105
module.exports = function(source, inputSourceMap) {
106-
// Handle filenames (#106)
107-
const webpackRemainingChain = loaderUtils
108-
.getRemainingRequest(this)
109-
.split("!");
110-
const filename = webpackRemainingChain[webpackRemainingChain.length - 1];
106+
const filename = this.resourcePath;
111107

112108
// Handle options
113109
const loaderOptions = loaderUtils.getOptions(this) || {};

src/resolve-rc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require("path");
22
const exists = require("./utils/exists");
33

44
module.exports = function find(fileSystem, start) {
5-
for (const fileName of [".babelrc", ".babelrc.js", "package.json"]) {
5+
for (const fileName of [".babelrc", "package.json"]) {
66
const file = path.join(start, fileName);
77

88
if (exists(fileSystem, file)) {

test/resolverc.test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ test("should find the .babelrc file", t => {
1010
t.is(result, path.join(__dirname, "fixtures/babelrc-test/.babelrc"));
1111
});
1212

13-
test("should find the .babelrc.js config", t => {
14-
const start = path.join(__dirname, "fixtures/babelrc-test/1/2/5/4");
15-
const result = resolveRc(fs, start);
16-
17-
t.is(result, path.join(__dirname, "fixtures/babelrc-test/1/2/5/.babelrc.js"));
18-
});
19-
2013
test("should find the package.json babel config", t => {
2114
const start = path.join(__dirname, "fixtures/package-test");
2215
const result = resolveRc(fs, start);

0 commit comments

Comments
 (0)