aboutsummaryrefslogtreecommitdiff
path: root/src/options.zig
blob: 3ffd24ab65183d8fa8ca4e6c080e0df318cfe802 (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 log = @import("logger.zig");

pub const Loader = enum {
    jsx,
    js,
    ts,
    tsx,
};

pub const TransformOptions = struct {
    footer: []u8 = "",
    banner: []u8 = "",
    define: std.StringHashMap([]u8),
    loader: Loader = Loader.tsx,
    resolve_dir: []u8 = "/",
    react_fast_refresh: bool = false,
    jsx_factory: []u8 = "React.createElement",
    jsx_pragma: []u8 = "jsx",
    inject: [][]u8,
    public_url: []u8,
    filesystem_cache: std.StringHashMap(fs.File),
    entry_point: fs.File,
};

pub const OutputFile = struct {
    path: []u8,
    contents: []u8,
};

pub const TransformResult = struct { errors: []log.Msg, warnings: []log.Msg, output_files: []OutputFile };