diff options
author | 2021-05-19 19:30:24 -0700 | |
---|---|---|
committer | 2021-05-19 19:30:24 -0700 | |
commit | a58adfcaa2bcbf24d568af3a0175a6a3ab4e1e05 (patch) | |
tree | 23a585cba094f192097422bf2c3e7b78256cadcf /src/options.zig | |
parent | 2884b759c3143d7ba1d44ec8c38987566940d050 (diff) | |
download | bun-a58adfcaa2bcbf24d568af3a0175a6a3ab4e1e05.tar.gz bun-a58adfcaa2bcbf24d568af3a0175a6a3ab4e1e05.tar.zst bun-a58adfcaa2bcbf24d568af3a0175a6a3ab4e1e05.zip |
Starting to work on rutnime
Former-commit-id: 23220fd348f86bda50fb4e4a64cce9c4b167499f
Diffstat (limited to 'src/options.zig')
-rw-r--r-- | src/options.zig | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/options.zig b/src/options.zig index 9d416ad66..f0c2f6f15 100644 --- a/src/options.zig +++ b/src/options.zig @@ -283,7 +283,7 @@ pub const BundleOptions = struct { jsx: JSX.Pragma = JSX.Pragma{}, react_fast_refresh: bool = false, inject: ?[]string = null, - public_url: string = "/", + public_url: string = "", output_dir: string = "", write: bool = false, preserve_symlinks: bool = false, @@ -295,6 +295,12 @@ pub const BundleOptions = struct { external: ExternalModules = ExternalModules{}, entry_points: []const string, extension_order: []const string = &Defaults.ExtensionOrder, + import_path_format: ImportPathFormat = ImportPathFormat.relative, + + pub const ImportPathFormat = enum { + relative, + absolute_url, + }; pub const Defaults = struct { pub var ExtensionOrder = [_]string{ ".tsx", ".ts", ".jsx", ".js", ".json" }; @@ -350,6 +356,11 @@ pub const BundleOptions = struct { .entry_points = transform.entry_points, }; + if (transform.public_url) |public_url| { + opts.import_path_format = ImportPathFormat.absolute_url; + opts.public_url = public_url; + } + if (transform.jsx) |jsx| { opts.jsx = try JSX.Pragma.fromApi(jsx, allocator); } @@ -380,7 +391,7 @@ pub const TransformOptions = struct { jsx: ?JSX.Pragma, react_fast_refresh: bool = false, inject: ?[]string = null, - public_url: string = "/", + public_url: string = "", preserve_symlinks: bool = false, entry_point: Fs.File, resolve_paths: bool = false, |