Skip to content

Commit e3e8246

Browse files
committed
fix programmatic api
1 parent f6feee7 commit e3e8246

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/processScript/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,18 @@ export async function processScript(code: string, {
258258
rollupPluginJSON({ preferConst: true }),
259259
{
260260
name: `hackmud-script-manager`,
261+
resolveId(source) {
262+
if (source == filePathResolved)
263+
return filePathResolved
264+
},
265+
async load(id) {
266+
if (id == filePathResolved)
267+
return (await preprocess(code, { uniqueId })).code
268+
},
261269
async transform(code, id) {
270+
if (id == filePathResolved)
271+
return
272+
262273
if (isAbsolutePath(id) && !id.includes(`${pathSeparator}node_modules${pathSeparator}`))
263274
return (await preprocess(code, { uniqueId })).code
264275

0 commit comments

Comments
 (0)