aboutsummaryrefslogtreecommitdiff
path: root/src/resolver/tsconfig_json.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-04-16 01:31:01 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-04-16 01:31:01 -0700
commit09357f55f9115bb05c57d07ee489a11e79b1a42b (patch)
tree0e8b6e4eadda21e9a6479bd27508a9ca1890d79e /src/resolver/tsconfig_json.zig
parent33049fa6fd17ee5dd85cb199f5836f400e308ae4 (diff)
downloadbun-09357f55f9115bb05c57d07ee489a11e79b1a42b.tar.gz
bun-09357f55f9115bb05c57d07ee489a11e79b1a42b.tar.zst
bun-09357f55f9115bb05c57d07ee489a11e79b1a42b.zip
Fix bugs with loading `jsxDEV` when it should be `jsx` or vice versa
Diffstat (limited to 'src/resolver/tsconfig_json.zig')
-rw-r--r--src/resolver/tsconfig_json.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/resolver/tsconfig_json.zig b/src/resolver/tsconfig_json.zig
index 68d3f28c9..7ce1fa358 100644
--- a/src/resolver/tsconfig_json.zig
+++ b/src/resolver/tsconfig_json.zig
@@ -161,7 +161,7 @@ pub const TSConfigJSON = struct {
if (options.JSX.RuntimeMap.get(str)) |runtime| {
result.jsx.runtime = runtime;
if (runtime == .automatic) {
- result.jsx.setProduction(allocator, strings.eqlComptime(str, "react-jsxDEV"));
+ result.jsx.setProduction(!strings.contains(str, "jsxDEV"));
is_jsx_development = result.jsx.development;
result.jsx_flags.insert(.development);
}
@@ -175,18 +175,12 @@ pub const TSConfigJSON = struct {
if (compiler_opts.expr.asProperty("jsxImportSource")) |jsx_prop| {
if (jsx_prop.expr.asString(allocator)) |str| {
if (str.len >= "solid-js".len and strings.eqlComptime(str[0.."solid-js".len], "solid-js")) {
- result.jsx.import_source = str;
result.jsx.runtime = .solid;
result.jsx_flags.insert(.runtime);
- } else {
- if (is_jsx_development) {
- result.jsx.setImportSource(allocator, "{s}/jsx-dev-runtime");
- } else {
- result.jsx.setImportSource(allocator, "{s}/jsx-runtime");
- }
}
result.jsx.package_name = options.JSX.Pragma.parsePackageName(str);
+ result.jsx.setImportSource(allocator);
result.jsx_flags.insert(.import_source);
}
}