aboutsummaryrefslogtreecommitdiff
path: root/src/bundler.zig
blob: d1a825a702c29c23f6edd528bc6c23de83dd5275 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const std = @import("std");
const options = @import("options.zig");
const logger = @import("logger.zig");
const js_ast = @import("js_ast.zig");

pub const Bundler = struct {
    options: options.TransformOptions,
    log: logger.Log,
    allocator: *std.mem.Allocator,
    result: ?options.TransformResult = null,

    pub fn init(options: options.TransformOptions, allocator: *std.mem.Allocator) Bundler {
        var log = logger.Log{ .msgs = ArrayList(Msg).init(allocator) };

        return Bundler{
            .options = options,
            .allocator = allocator,
            .log = log,
        };
    }

    pub fn scan(self: *Bundler) void {}

    pub fn bundle(self: *Bundler) options.TransformResult {
        var result = self.result;

        var source = logger.Source.initFile(self.options.entry_point, self.allocator);

        
    }
};