From d5c05d857f35f1eb101cbbd9d2b646994333d3b1 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 11 Mar 2023 00:25:32 +0100 Subject: [PATCH] Add DevOnly plugin capability --- scripts/build/common.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs index c6a082d..1689470 100644 --- a/scripts/build/common.mjs +++ b/scripts/build/common.mjs @@ -69,9 +69,9 @@ export const globPlugins = { const files = await readdir(`./src/${dir}`); for (const file of files) { if (file.startsWith(".")) continue; - if (file === "index.ts") { - continue; - } + if (file === "index.ts") continue; + if (!watch && (file.endsWith(".dev.ts") || file.endsWith(".dev.tsx"))) continue; + const mod = `p${i}`; code += `import ${mod} from "./${dir}/${file.replace(/\.tsx?$/, "")}";\n`; plugins += `[${mod}.name]:${mod},\n`;