aboutsummaryrefslogtreecommitdiff
path: root/src/resolver
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-01-27 01:25:39 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-01-27 01:25:39 -0800
commitff2335a910d8ab012193c1e5d48e24012408fb4c (patch)
treef0ee6f610a3208b3b1f377963fba8bed9908ea92 /src/resolver
parent32733210dc1de752e297ad4b2d4893d7a22ae4f6 (diff)
downloadbun-ff2335a910d8ab012193c1e5d48e24012408fb4c.tar.gz
bun-ff2335a910d8ab012193c1e5d48e24012408fb4c.tar.zst
bun-ff2335a910d8ab012193c1e5d48e24012408fb4c.zip
Stop reading `"bun"` from package.json
cc @hanford
Diffstat (limited to 'src/resolver')
-rw-r--r--src/resolver/package_json.zig29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/resolver/package_json.zig b/src/resolver/package_json.zig
index eefb5474b..1ac221998 100644
--- a/src/resolver/package_json.zig
+++ b/src/resolver/package_json.zig
@@ -71,9 +71,6 @@ pub const PackageJSON = struct {
scripts: ?*ScriptsMap = null,
- always_bundle: []string = &.{},
- macros: MacroMap = MacroMap{},
-
// Present if the "browser" field is present. This field is intended to be
// used by bundlers and lets you redirect the paths of certain 3rd-party
// modules that don't work in the browser to other modules that shim that
@@ -566,7 +563,6 @@ pub const PackageJSON = struct {
.hash = 0xDEADBEEF,
.source = json_source,
.module_type = .unknown,
- .macros = MacroMap{},
.browser_map = BrowserMap.init(r.allocator),
.main_fields = MainFieldMap.init(r.allocator),
};
@@ -616,31 +612,6 @@ pub const PackageJSON = struct {
}
}
- if (json.asProperty("bun")) |bun_json| {
- if (bun_json.expr.asProperty("alwaysBundle")) |bundle_| {
- if (bundle_.expr.data == .e_array) {
- var always_bundle_count: u16 = 0;
- const array = bundle_.expr.data.e_array.items;
- for (array) |item| {
- always_bundle_count += @intCast(u16, @boolToInt(item.data == .e_string and item.data.e_string.utf8.len > 0));
- }
- package_json.always_bundle = r.allocator.alloc(string, always_bundle_count) catch unreachable;
-
- var i: u16 = 0;
- for (array) |item| {
- if (!(item.data == .e_string and item.data.e_string.utf8.len > 0)) continue;
- package_json.always_bundle[i] = item.asString(r.allocator).?;
- i += 1;
- }
- // for (var i = 0; i < bundle_.expr.data.e_array.len; i++) {
- }
- }
-
- if (bun_json.expr.asProperty("macros")) |macros| {
- package_json.macros = parseMacrosJSON(r.allocator, macros.expr, r.log, &json_source);
- }
- }
-
// Read the "main" fields
for (r.opts.main_fields) |main| {
if (json.asProperty(main)) |main_json| {