aboutsummaryrefslogtreecommitdiff
path: root/src/bundler/generate_node_modules_bundle.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/bundler/generate_node_modules_bundle.zig')
-rw-r--r--src/bundler/generate_node_modules_bundle.zig17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/bundler/generate_node_modules_bundle.zig b/src/bundler/generate_node_modules_bundle.zig
index 69216ae72..25cfe912d 100644
--- a/src/bundler/generate_node_modules_bundle.zig
+++ b/src/bundler/generate_node_modules_bundle.zig
@@ -184,9 +184,7 @@ pub const ThreadPool = struct {
pub fn run(this: *Worker) void {
Output.Source.configureThread();
this.thread_id = std.Thread.getCurrentId();
- if (Environment.isDebug) {
- Output.prettyln("Thread started.\n", .{});
- }
+
js_ast.Expr.Data.Store.create(this.generator.allocator);
js_ast.Stmt.Data.Store.create(this.generator.allocator);
this.data = this.generator.allocator.create(WorkerData) catch unreachable;
@@ -1310,7 +1308,7 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
opts.transform_require_to_import = false;
opts.features.dynamic_require = bundler.options.platform.isBun();
- opts.enable_bundling = true;
+ opts.enable_legacy_bundling = true;
opts.warn_about_unbundled_modules = false;
opts.macro_context = &worker.data.macro_context;
opts.features.auto_import_jsx = jsx.parse;
@@ -1358,7 +1356,7 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
}
var path = _resolved_import.path() orelse {
import_record.path.is_disabled = true;
- import_record.is_bundled = true;
+
continue;
};
@@ -1366,7 +1364,7 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
if (!loader_.isJavaScriptLikeOrJSON()) {
import_record.path.is_disabled = true;
- import_record.is_bundled = true;
+
continue;
}
@@ -1384,13 +1382,12 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
// we just silently disable it
// because...we need some kind of hook to say "don't bundle this"
import_record.path.is_disabled = true;
- import_record.is_bundled = false;
+ import_record.tag = .macro;
continue;
};
import_record.module_id = _module_data.module_id;
std.debug.assert(import_record.module_id != 0);
- import_record.is_bundled = true;
path.* = try path.dupeAlloc(this.allocator);
@@ -1526,7 +1523,7 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
ast.runtime_imports = runtime.Runtime.Imports{};
ast.runtime_imports.@"$$m" = .{ .ref = Ref.atIndex(0), .primary = Ref.None, .backup = Ref.None };
ast.runtime_imports.__export = .{ .ref = Ref.atIndex(1), .primary = Ref.None, .backup = Ref.None };
- ast.symbols = &json_ast_symbols;
+ ast.symbols = js_ast.Symbol.List.init(&json_ast_symbols);
ast.module_ref = Ref.atIndex(2);
ast.exports_ref = ast.runtime_imports.__export.?.ref;
ast.bundle_export_ref = Ref.atIndex(3);
@@ -1676,7 +1673,6 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
&source,
false,
js_printer.Options{
- .to_module_ref = Ref.RuntimeRef,
.bundle_export_ref = ast.runtime_imports.@"$$m".?.ref,
.source_path = file_path,
.externals = ast.externals,
@@ -1704,7 +1700,6 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
&source,
true,
js_printer.Options{
- .to_module_ref = Ref.RuntimeRef,
.bundle_export_ref = ast.runtime_imports.@"$$m".?.ref,
.source_path = file_path,
.externals = ast.externals,