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}); };