From e2eeed862fdcd3b07ffb93b8a6213ac2e6cb2158 Mon Sep 17 00:00:00 2001 From: Robby6Strings Date: Sun, 14 Apr 2024 05:15:29 +1200 Subject: [PATCH] ^ vpk --- packages/vite-plugin-kaioken/package.json | 2 +- packages/vite-plugin-kaioken/src/index.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/vite-plugin-kaioken/package.json b/packages/vite-plugin-kaioken/package.json index eb10da4f..b8707b30 100644 --- a/packages/vite-plugin-kaioken/package.json +++ b/packages/vite-plugin-kaioken/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-kaioken", - "version": "0.3.2", + "version": "0.3.3", "description": "", "main": "dist/index.js", "type": "module", diff --git a/packages/vite-plugin-kaioken/src/index.ts b/packages/vite-plugin-kaioken/src/index.ts index d656be1b..3bbdab88 100644 --- a/packages/vite-plugin-kaioken/src/index.ts +++ b/packages/vite-plugin-kaioken/src/index.ts @@ -26,12 +26,22 @@ export default function ( let isProduction = false let isBuild = false - const kaiokenModuleId = require + let kaiokenModuleId = require .resolve("kaioken", { paths: [process.cwd()], }) .replace(/\\/g, "/") - .replace("index.js", "dist/index.js") + if (kaiokenModuleId.endsWith("/lib/index.js")) { + kaiokenModuleId = kaiokenModuleId.replace( + "/lib/index.js", + "/lib/dist/index.js" + ) + } + + console.log( + "[vite-plugin-kaioken]: resolved kaioken module id", + kaiokenModuleId + ) return { name: "vite-plugin-kaioken",