diff options
author | 2023-04-29 00:08:48 -0400 | |
---|---|---|
committer | 2023-04-28 21:08:48 -0700 | |
commit | 96e113f41c0dae1ccd58c6d1e3b6dd2c54769636 (patch) | |
tree | 1f8c0b88d2daa925abff610f4a458d744bc0bf36 /src/linker.zig | |
parent | bc0c0f7d203567a5538f271a3bc37c450eeaee46 (diff) | |
download | bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.tar.gz bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.tar.zst bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.zip |
bundler tests: rest of default.test.ts and starting jsx tests (#2765)
Diffstat (limited to 'src/linker.zig')
-rw-r--r-- | src/linker.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/linker.zig b/src/linker.zig index 27a1db2b6..6c5e0e50b 100644 --- a/src/linker.zig +++ b/src/linker.zig @@ -172,7 +172,7 @@ pub const Linker = struct { } pub inline fn nodeModuleBundleImportPath(this: *const ThisLinker, origin: URL) string { - if (this.options.platform.isBun()) return "/node_modules.server.bun"; + if (this.options.target.isBun()) return "/node_modules.server.bun"; return std.fmt.allocPrint(this.allocator, "{s}://{}{s}", .{ origin.displayProtocol(), origin.displayHost(), this.options.node_modules_bundle.?.bundle.import_from_name }) catch unreachable; } @@ -334,7 +334,7 @@ pub const Linker = struct { import_record.range.loc, if (is_bun) JSC.JSGlobalObject.BunPluginTarget.bun - else if (linker.options.platform == .browser) + else if (linker.options.target == .browser) JSC.JSGlobalObject.BunPluginTarget.browser else JSC.JSGlobalObject.BunPluginTarget.node, @@ -731,12 +731,12 @@ pub const Linker = struct { had_resolve_errors = true; if (import_record.path.text.len > 0 and Resolver.isPackagePath(import_record.path.text)) { - if (linker.options.platform.isWebLike() and Options.ExternalModules.isNodeBuiltin(import_record.path.text)) { + if (linker.options.target.isWebLike() and Options.ExternalModules.isNodeBuiltin(import_record.path.text)) { try linker.log.addResolveError( &result.source, import_record.range, linker.allocator, - "Could not resolve: \"{s}\". Try setting --platform=\"node\" (after bun build exists)", + "Could not resolve: \"{s}\". Try setting --target=\"node\"", .{import_record.path.text}, import_record.kind, err, @@ -998,7 +998,7 @@ pub const Linker = struct { import_record.path = try linker.generateImportPath( source_dir, - if (path.is_symlink and import_path_format == .absolute_url and linker.options.platform.isNotBun()) path.pretty else path.text, + if (path.is_symlink and import_path_format == .absolute_url and linker.options.target.isNotBun()) path.pretty else path.text, loader == .file or loader == .wasm, path.namespace, origin, @@ -1026,7 +1026,7 @@ pub const Linker = struct { // it's more complicated // loader plugins could be executed between when this is called and the import is evaluated // but we want to preserve the semantics of "file" returning import paths for compatibiltiy with frontend frameworkss - if (!linker.options.platform.isBun()) { + if (!linker.options.target.isBun()) { import_record.print_mode = .import_path; } }, |