From 2ae48900a6d0ecbcb9adafd1d12f58519abd9b49 Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Sat, 19 Oct 2024 16:32:22 +0300 Subject: [PATCH] fix: Fix bundled assets --- src/plugin/transform-node.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugin/transform-node.ts b/src/plugin/transform-node.ts index d4c636b..7a29e11 100644 --- a/src/plugin/transform-node.ts +++ b/src/plugin/transform-node.ts @@ -13,7 +13,7 @@ function copy(from: string, to: string) { export function onBundle(env: {bundled: Set}, output: string, runtime: RuntimeObj) { env.bundled.add(PACKAGE); - const root = dirname(require.resolve(join(PACKAGE, 'runtime'))); + const root = join(__dirname, '..', 'runtime'); RUNTIME.forEach((file) => { switch (true) { @@ -27,6 +27,6 @@ export function onBundle(env: {bundled: Set}, output: string, runtime: R }); } -export const transform = (options?: Partial) => { - return baseTransform(options); +export const transform = (options?: Partial>) => { + return baseTransform({...options, onBundle}); };