forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.zig
45 lines (40 loc) · 1.38 KB
/
config.zig
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
const Environment = bun.Environment;
const strings = bun.strings;
const MutableString = bun.MutableString;
const stringZ = bun.stringZ;
const default_allocator = bun.default_allocator;
const C = bun.C;
const std = @import("std");
const Fs = @import("../fs.zig");
const resolver = @import("../resolver/resolver.zig");
const ast = @import("../import_record.zig");
const logger = @import("root").bun.logger;
const Api = @import("../api/schema.zig").Api;
const options = @import("../options.zig");
const Bundler = bun.bundler.ServeBundler;
const js_printer = bun.js_printer;
const http = @import("../http.zig");
pub const DefaultBunDefines = struct {
pub const Keys = struct {
const window = "window";
};
pub const Values = struct {
const window = "undefined";
};
};
pub fn configureTransformOptionsForBunVM(allocator: std.mem.Allocator, _args: Api.TransformOptions) !Api.TransformOptions {
var args = _args;
// args.serve = false;
args.write = false;
args.resolve = Api.ResolveMode.lazy;
return try configureTransformOptionsForBun(allocator, args);
}
pub fn configureTransformOptionsForBun(_: std.mem.Allocator, _args: Api.TransformOptions) !Api.TransformOptions {
var args = _args;
args.target = Api.Target.bun;
return args;
}