diff options
author | 2021-05-12 20:33:58 -0700 | |
---|---|---|
committer | 2021-05-12 20:33:58 -0700 | |
commit | f12ed9904b03e11f755dce7b614925ea087f40da (patch) | |
tree | cfbbcab5ee4931d67b8e15d8175291675019ab92 /src/options.zig | |
parent | 1010bae1a350d12f7db49b8ca7f94aa748790b77 (diff) | |
download | bun-f12ed9904b03e11f755dce7b614925ea087f40da.tar.gz bun-f12ed9904b03e11f755dce7b614925ea087f40da.tar.zst bun-f12ed9904b03e11f755dce7b614925ea087f40da.zip |
okay I think that's most of resolving packages/imports algorithm!!!
Former-commit-id: 80037859ec5236e13314a336e28d5f46a96c3300
Diffstat (limited to 'src/options.zig')
-rw-r--r-- | src/options.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/options.zig b/src/options.zig index 265c11148..9d5f91699 100644 --- a/src/options.zig +++ b/src/options.zig @@ -294,6 +294,12 @@ pub const BundleOptions = struct { log: *logger.Log, external: ExternalModules = ExternalModules{}, entry_points: []const string, + extension_order: []const string = &Defaults.ExtensionOrder, + + pub const Defaults = struct { + pub var ExtensionOrder = [_]string{ ".tsx", ".ts", ".jsx", ".js", ".json" }; + }; + pub fn fromApi( allocator: *std.mem.Allocator, fs: *Fs.FileSystem, @@ -338,6 +344,10 @@ pub const BundleOptions = struct { opts.jsx = try JSX.Pragma.fromApi(jsx, allocator); } + if (transform.extension_order.len > 0) { + opts.extension_order = transform.extension_order; + } + if (transform.platform) |plat| { opts.platform = if (plat == .browser) .browser else .node; opts.main_fields = Platform.DefaultMainFields.get(opts.platform); |