Skip to content

Commit 4573896

Browse files
committed
Switch to @deno/esbuild-plugin and update imports
Replaced esbuild-plugin-solid with @deno/esbuild-plugin in build configuration for improved Deno compatibility. Updated deno.json imports to use npm:solid-js and jsr modules, and removed unused Solid.js ESM imports. Adjusted esbuild options for browser platform and automatic JSX.
1 parent d8ac486 commit 4573896

File tree

3 files changed

+69
-413
lines changed

3 files changed

+69
-413
lines changed

build/esbuild.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
/// <reference lib="deno.ns" />
22
import * as esbuild from '@esbuild';
3-
import { solidPlugin as esbuildPluginSolidJs } from '@esbuild-plugin-solid';
3+
import { denoPlugin as esbuildPluginDeno } from "@deno/esbuild-plugin";
44
import { green } from '@std/fmt/colors';
55
import { parseArgs } from '@std/cli/parse-args';
66

7-
import denoJson from '../deno.json' with {type: 'json'}
8-
97
const args = parseArgs<{
108
watch: boolean | undefined,
119
develop: boolean | undefined,
@@ -53,6 +51,9 @@ const filesConfig : esbuild.BuildOptions = {
5351
bundle: true,
5452
format: 'esm',
5553
target: 'esnext',
54+
platform: 'browser',
55+
jsx: 'automatic',
56+
jsxImportSource: '@solid-js/h',
5657
sourcemap: args.develop ? 'linked' : false,
5758
sourcesContent: true,
5859
outdir: './dist',
@@ -65,9 +66,11 @@ const filesConfig : esbuild.BuildOptions = {
6566
'nesting': true
6667
},
6768
plugins: [
68-
esbuildPluginSolidJs({solid: {moduleName: '@solid-js/web'}})
69-
],
70-
alias: denoJson.imports
69+
esbuildPluginDeno({
70+
preserveJsx: true,
71+
debug: args.develop ?? false
72+
}),
73+
]
7174
}
7275

7376
console.log('Build process started.');

deno.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,11 @@
107107
}
108108
},
109109
"imports": {
110+
"@deno/esbuild-plugin": "jsr:@deno/esbuild-plugin@^1.2.0",
110111
"@esbuild": "npm:esbuild@^0.25.11",
111-
"@esbuild-plugin-solid": "npm:esbuild-plugin-solid@^0.6.0",
112-
"@solid-js": "https://esm.sh/[email protected]",
113-
"@solid-js/jsx-runtime": "https://esm.sh/[email protected]/jsx-runtime",
114-
"@solid-js/web": "https://esm.sh/[email protected]/web",
115-
"@std/cli/parse-args": "jsr:@std/cli@^1.0.6/parse-args",
116-
"@std/http/unstable-route": "jsr:@std/http@^1.0.6/unstable-route",
117-
"@std/http/file-server": "jsr:@std/http@^1.0.6/file-server",
118-
"@std/fmt/colors": "jsr:@std/fmt@^1.0.2/colors"
112+
"@solid-js": "npm:[email protected]",
113+
"@std/cli": "jsr:@std/cli@^1.0.6",
114+
"@std/http": "jsr:@std/http@^1.0.6",
115+
"@std/fmt": "jsr:@std/fmt@^1.0.2"
119116
}
120117
}

0 commit comments

Comments
 (0)