Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
fix: Entry point path failure when resolving at runtime (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchanged committed Oct 3, 2017
1 parent 0646063 commit abd760f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion modules/fuse-box-loader-api/fusebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ function $getRef(name, o) {
name = name ? name : "./" + pkg.s.entry;
var filePath = $pathJoin(basePath, name);
var validPath = $ensureExtension(filePath);
if (filePath === ".") {
validPath = pkg.s.entry || "index.js";
}
var file = pkg.f[validPath];
var wildcard;
if (!file && validPath.indexOf("*") > -1) {
Expand All @@ -153,7 +156,8 @@ function $getRef(name, o) {
validPath = $pathJoin(filePath, "/", "index.js");
file = pkg.f[validPath];
if (!file && filePath === ".") {
file = pkg.f[pkg.s && pkg.s.entry];
validPath = pkg.s && pkg.s.entry || "index.js";
file = pkg.f[validPath];
}
if (!file) {
validPath = filePath + ".js";
Expand Down
2 changes: 1 addition & 1 deletion modules/fuse-box-loader-api/fusebox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/loader/LoaderAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ function $getRef(name: string, o: RefOpts): IReference {
file = pkg.f[validPath];

if (!file && filePath === ".") {
file = pkg.f[pkg.s && pkg.s.entry];
validPath = pkg.s && pkg.s.entry || "index.js";
file = pkg.f[validPath];
}
// last resort try adding .js extension
// Some libraries have a weired convention of naming file lile "foo.bar""
Expand Down

0 comments on commit abd760f

Please sign in to comment.