@@ -43,9 +43,9 @@ export const InlineWasmBunPlugin: BunPlugin = {
43
43
// Hook into the "resolve" phase to intercept .wasm imports
44
44
builder . onResolve ( { filter : / \. w a s m $ / } , async ( args ) => {
45
45
// Resolve the .wasm file path relative to the directory of the importing file
46
- const resolvedPath = path . resolve (
47
- path . dirname ( args . importer ) ,
46
+ const resolvedPath = Bun . resolveSync (
48
47
args . path ,
48
+ path . dirname ( args . importer ) ,
49
49
) ;
50
50
return { path : resolvedPath , namespace : "wasm" } ;
51
51
} ) ;
@@ -74,9 +74,9 @@ export const InlineSqlBunPlugin: BunPlugin = {
74
74
// Hook into the "resolve" phase to intercept .sql imports
75
75
builder . onResolve ( { filter : / \. s q l $ / } , async ( args ) => {
76
76
// Resolve the .sql file path relative to the directory of the importing file
77
- const resolvedPath = path . resolve (
78
- path . dirname ( args . importer ) ,
77
+ const resolvedPath = Bun . resolveSync (
79
78
args . path ,
79
+ path . dirname ( args . importer ) ,
80
80
) ;
81
81
return { path : resolvedPath , namespace : "sql" } ;
82
82
} ) ;
@@ -144,6 +144,8 @@ export interface BuildConfig {
144
144
sourcemap : boolean ;
145
145
}
146
146
147
+ const defaultBunPlugins = [ InlineSqlBunPlugin ] ;
148
+
147
149
export function build ( config : BuildConfig ) {
148
150
const createOutputFolder = ResultAsync . fromPromise (
149
151
$ `mkdir -p ${ config . outputFolder } ` ,
@@ -184,8 +186,8 @@ export function build(config: BuildConfig) {
184
186
target : "browser" ,
185
187
format : config . format ,
186
188
plugins : config . useWasm
187
- ? [ InlineWasmBunPlugin , InlineSqlBunPlugin ]
188
- : [ InlineSqlBunPlugin ] ,
189
+ ? [ InlineWasmBunPlugin , ... defaultBunPlugins ]
190
+ : defaultBunPlugins ,
189
191
drop : config . drop ,
190
192
sourcemap : config . sourcemap ? "inline" : "none" ,
191
193
external : [
0 commit comments