aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-03-19 00:12:55 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-03-19 00:12:55 -0700
commit0134c14ebf7c930c771709a78b7b1cffb00aedf3 (patch)
tree8c488193b8157c082788d78d412b72c0564a8f60
parentd87ea9c88a30938306052b25eddf7dd906f3cab9 (diff)
downloadbun-0134c14ebf7c930c771709a78b7b1cffb00aedf3.tar.gz
bun-0134c14ebf7c930c771709a78b7b1cffb00aedf3.tar.zst
bun-0134c14ebf7c930c771709a78b7b1cffb00aedf3.zip
Remove relative_nodejs import path format
-rw-r--r--src/bundler.zig4
-rw-r--r--src/linker.zig24
-rw-r--r--src/options.zig4
3 files changed, 1 insertions, 31 deletions
diff --git a/src/bundler.zig b/src/bundler.zig
index 616979cb2..950d37b7b 100644
--- a/src/bundler.zig
+++ b/src/bundler.zig
@@ -3166,7 +3166,6 @@ pub const Bundler = struct {
did_start = true;
try switch (bundler.options.import_path_format) {
.relative => bundler.processResolveQueue(.relative, true, @TypeOf(outstream), outstream),
- .relative_nodejs => bundler.processResolveQueue(.relative_nodejs, true, @TypeOf(outstream), outstream),
.absolute_url => bundler.processResolveQueue(.absolute_url, true, @TypeOf(outstream), outstream),
.absolute_path => bundler.processResolveQueue(.absolute_path, true, @TypeOf(outstream), outstream),
.package_path => bundler.processResolveQueue(.package_path, true, @TypeOf(outstream), outstream),
@@ -3178,7 +3177,6 @@ pub const Bundler = struct {
if (!did_start) {
try switch (bundler.options.import_path_format) {
.relative => bundler.processResolveQueue(.relative, false, @TypeOf(outstream), outstream),
- .relative_nodejs => bundler.processResolveQueue(.relative_nodejs, false, @TypeOf(outstream), outstream),
.absolute_url => bundler.processResolveQueue(.absolute_url, false, @TypeOf(outstream), outstream),
.absolute_path => bundler.processResolveQueue(.absolute_path, false, @TypeOf(outstream), outstream),
.package_path => bundler.processResolveQueue(.package_path, false, @TypeOf(outstream), outstream),
@@ -3197,7 +3195,6 @@ pub const Bundler = struct {
did_start = true;
try switch (bundler.options.import_path_format) {
.relative => bundler.processResolveQueue(.relative, true, std.fs.Dir, output_dir),
- .relative_nodejs => bundler.processResolveQueue(.relative_nodejs, true, std.fs.Dir, output_dir),
.absolute_url => bundler.processResolveQueue(.absolute_url, true, std.fs.Dir, output_dir),
.absolute_path => bundler.processResolveQueue(.absolute_path, true, std.fs.Dir, output_dir),
.package_path => bundler.processResolveQueue(.package_path, true, std.fs.Dir, output_dir),
@@ -3209,7 +3206,6 @@ pub const Bundler = struct {
if (!did_start) {
try switch (bundler.options.import_path_format) {
.relative => bundler.processResolveQueue(.relative, false, std.fs.Dir, output_dir),
- .relative_nodejs => bundler.processResolveQueue(.relative_nodejs, false, std.fs.Dir, output_dir),
.absolute_url => bundler.processResolveQueue(.absolute_url, false, std.fs.Dir, output_dir),
.absolute_path => bundler.processResolveQueue(.absolute_path, false, std.fs.Dir, output_dir),
.package_path => bundler.processResolveQueue(.package_path, false, std.fs.Dir, output_dir),
diff --git a/src/linker.zig b/src/linker.zig
index 129070e9d..7d0a3ac41 100644
--- a/src/linker.zig
+++ b/src/linker.zig
@@ -638,30 +638,6 @@ pub const Linker = struct {
return Fs.Path.initWithPretty(pretty, relative_name);
},
- .relative_nodejs => {
- var relative_name = linker.fs.relative(source_dir, source_path);
- var pretty: string = undefined;
- if (use_hashed_name) {
- var basepath = Fs.Path.init(source_path);
- const basename = try linker.getHashedFilename(basepath, null);
- var dir = basepath.name.dirWithTrailingSlash();
- var _pretty = try linker.allocator.alloc(u8, dir.len + basename.len + basepath.name.ext.len);
- std.mem.copy(u8, _pretty, dir);
- var remaining_pretty = _pretty[dir.len..];
- std.mem.copy(u8, remaining_pretty, basename);
- remaining_pretty = remaining_pretty[basename.len..];
- std.mem.copy(u8, remaining_pretty, basepath.name.ext);
- pretty = _pretty;
- relative_name = try linker.allocator.dupe(u8, relative_name);
- } else {
- pretty = try linker.allocator.dupe(u8, relative_name);
- relative_name = pretty;
- }
-
- var path = Fs.Path.initWithPretty(pretty, relative_name);
- path.text = path.text[0 .. path.text.len - path.name.ext.len];
- return path;
- },
.absolute_url => {
if (strings.eqlComptime(namespace, "node")) {
diff --git a/src/options.zig b/src/options.zig
index 90fda4186..8288d7ce3 100644
--- a/src/options.zig
+++ b/src/options.zig
@@ -1208,8 +1208,6 @@ pub const BundleOptions = struct {
pub const ImportPathFormat = enum {
relative,
- // omit file extension for Node.js packages
- relative_nodejs,
absolute_url,
// omit file extension
absolute_path,
@@ -1315,7 +1313,7 @@ pub const BundleOptions = struct {
switch (opts.platform) {
.node => {
- opts.import_path_format = .relative_nodejs;
+ opts.import_path_format = .relative;
opts.allow_runtime = false;
},
.bun => {