aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/config.zig
blob: 2f91e433d3db7f725f84d7c761388894df25eba4 (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
32
33
34
35
36
37
38
39
40
41
usingnamespace @import("../../global.zig");
const std = @import("std");

const Fs = @import("../../fs.zig");
const resolver = @import("../../resolver/resolver.zig");
const ast = @import("../../import_record.zig");
const NodeModuleBundle = @import("../../node_module_bundle.zig").NodeModuleBundle;
const logger = @import("../../logger.zig");
const Api = @import("../../api/schema.zig").Api;
const options = @import("../../options.zig");
const Bundler = @import("../../bundler.zig").ServeBundler;
const js_printer = @import("../../js_printer.zig");
const hash_map = @import("../../hash_map.zig");
const http = @import("../../http.zig");

usingnamespace @import("./node_env_buf_map.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;
    args.generate_node_module_bundle = false;
    return try configureTransformOptionsForBun(allocator, args);
}

pub fn configureTransformOptionsForBun(allocator: *std.mem.Allocator, _args: Api.TransformOptions) !Api.TransformOptions {
    var args = _args;
    args.platform = Api.Platform.bun;
    return args;
}
='//www.gravatar.com/avatar/69f9dd448e2d032d37d2e99b6d9d3a0c?s=13&d=retro' width='13' height='13' alt='Gravatar' /> Jonathan Rubin 4-15/+31 * Updated react example template * build:(landing) automated website build * removed bun.lockb and most of changes from react example index.html Co-authored-by: rubinj30 <rubinj30@users.noreply.github.com> 2022-07-14fix(templates/blank): Update bun types (#704)Gravatar Hyro 1-1/+1 2022-07-14fix(templates): Fix hono example template (#633)Gravatar YOSHIKI 2-3/+3 * Fix hono example template * Update package.json 2022-07-14fix(packages/bun-landing): Fixed punctuation (#280)Gravatar Mustafa Hasan Khan 3-6/+6 2022-07-14fix small typo in readme (#706)Gravatar 0xflotus 1-1/+1 2022-07-14docs: remove emulating cpu section (#714)Gravatar Robert Soriano 1-22/+0 2022-07-13docs: correct typo missing dots (#603)Gravatar pnxdxt 1-11/+11 2022-07-13docs: Substitute npm install with bun add (#670)Gravatar Fábio Santos 1-2/+2 2022-07-13fix(napi): gurantee -> guarantee (#683)Gravatar Ikko Ashimine 1-2/+2 2022-07-13fix(README): Add punctuation (#611)Gravatar Omer Shahar 1-31/+31 2022-07-13docs: Add bun-bakery template (#649)Gravatar Dennis Dudek 6-0/+69 2022-07-13fix: og:image share url (#678)Gravatar Gabriel Nunes 1-1/+1 * feat: create share image for social media * fix: group meta tags * fix: adjust og:image to full url 2022-07-13add node:http Server polyfill (#572)Gravatar evan 2-2/+556 * node:http polyfill * remove @ts-ignore * reuse emitter instance * requested changes * cleanup Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> 2022-07-13docs: Link esbuild and @evanw in README (#669)Gravatar Thomas Jaggi 1-1/+1 2022-07-13fix(env_loader): Off by one error (#668)Gravatar Finn R. Gärtner 1-1/+1 2022-07-13Typesbun-v0.1.4Gravatar Jarred Sumner 2-22/+27 2022-07-13switch from stream-browserify to readable-streamGravatar evanwashere 3-27/+1512 2022-07-13Add a console.log benchGravatar Jarred Sumner 3-0/+12 2022-07-13Add newline to symbols (fixes warning)Gravatar Jarred Sumner 1-1/+1 2022-07-13fix benchmark not building with old rust versionGravatar evanwashere 6-11/+11 2022-07-12[http] Fix assertionGravatar Jarred Sumner 1-1/+1 2022-07-12[bun.js] GC more stringsGravatar Jarred Sumner 2-4/+8 2022-07-12[bun install] Handle case that should really never happenGravatar Jarred Sumner 1-10/+12 2022-07-12[bun.js] Fix GC bug with `fetch`Gravatar Jarred Sumner 1-68/+29