Skip to content

Commit e3adff6

Browse files
committed
small fixes
1 parent 8fa1e19 commit e3adff6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-plugin-transform-barrels",
3-
"version": "1.0.16",
3+
"version": "1.0.17",
44
"description": "A Babel plugin that transforms indirect imports through a barrel file (index.js) into direct imports.",
55
"homepage": "https://github.com/FogelAI/babel-plugin-transform-barrels",
66
"main": "src/main.js",

src/barrel.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ class BarrelFile {
149149
const { exportedName } = specifierObj;
150150
const deepestDirectSpecifier = this.getDeepestDirectSpecifierObject(specifierObj);
151151
deepestDirectSpecifier.esmPath = PathFunctions.normalizeModulePath(deepestDirectSpecifier.esmPath);
152-
if (!this.defaultPatternExport.isMatchDefaultPattern(deepestDirectSpecifier)) {
153-
this.exportMapping[exportedName] = deepestDirectSpecifier;
154-
}
152+
this.exportMapping[exportedName] = deepestDirectSpecifier;
155153
}
156154
}
157155
}
@@ -230,7 +228,8 @@ class BarrelFile {
230228
getDeepestDirectSpecifierObject(specifierObj) {
231229
const { esmPath, localName } = specifierObj;
232230
if (BarrelFile.isBarrelFilename(esmPath)) {
233-
const barrelFile = BarrelFileManagerFacade.getBarrelFile(esmPath);
231+
const absEsmFile = resolver.resolve(esmPath ,this.path).absEsmFile;
232+
const barrelFile = BarrelFileManagerFacade.getBarrelFile(absEsmFile);
234233
if (barrelFile.isBarrelFileContent) {
235234
const deepestSpecifier = barrelFile.getDirectSpecifierObject(localName);
236235
return this.getDeepestDirectSpecifierObject(deepestSpecifier);

0 commit comments

Comments
 (0)