Former-commit-id: 5f72442386
This commit is contained in:
Jarred Sumner
2021-05-24 12:44:13 -07:00
parent 6aa88ae931
commit db6ac5f51b
2 changed files with 5 additions and 7 deletions

View File

@@ -311,12 +311,9 @@ pub const Bundler = struct {
// Resolving a public file has special behavior
if (bundler.options.public_dir_enabled) {
// On Windows, we don't keep the directory handle open forever because Windows doesn't like that.
const public_dir: std.fs.Dir = bundler.options.public_dir_handle orelse std.fs.openDirAbsolute(resolve_path.normalizeAndJoin(
bundler.fs.top_level_dir,
.auto,
bundler.options.public_dir,
), .{}) catch |err| {
const public_dir: std.fs.Dir = bundler.options.public_dir_handle orelse std.fs.openDirAbsolute(bundler.options.public_dir, .{}) catch |err| {
log.addErrorFmt(null, logger.Loc.Empty, allocator, "Opening public directory failed: {s}", .{@errorName(err)}) catch unreachable;
Output.printErrorln("Opening public directory failed: {s}", .{@errorName(err)});
bundler.options.public_dir_enabled = false;
return error.PublicDirError;
};

View File

@@ -180,8 +180,8 @@ pub const Cli = struct {
var react_fast_refresh = args.flag("--react-fast-refresh");
var main_fields = args.options("--main-fields");
comptime const PlatformMatcher = strings.ExactSizeMatcher(8);
comptime const ResoveMatcher = strings.ExactSizeMatcher(8);
const PlatformMatcher = strings.ExactSizeMatcher(8);
const ResoveMatcher = strings.ExactSizeMatcher(8);
var resolve = Api.ResolveMode.lazy;
if (args.option("--resolve")) |_resolve| {
@@ -295,6 +295,7 @@ pub const Cli = struct {
if (args.serve orelse false) {
try Server.start(allocator, args);
return;
}