Add DevOnly plugin capability

This commit is contained in:
Vendicated 2023-03-11 00:25:32 +01:00
parent bff6788546
commit d5c05d857f
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905

View file

@ -69,9 +69,9 @@ export const globPlugins = {
const files = await readdir(`./src/${dir}`); const files = await readdir(`./src/${dir}`);
for (const file of files) { for (const file of files) {
if (file.startsWith(".")) continue; if (file.startsWith(".")) continue;
if (file === "index.ts") { if (file === "index.ts") continue;
continue; if (!watch && (file.endsWith(".dev.ts") || file.endsWith(".dev.tsx"))) continue;
}
const mod = `p${i}`; const mod = `p${i}`;
code += `import ${mod} from "./${dir}/${file.replace(/\.tsx?$/, "")}";\n`; code += `import ${mod} from "./${dir}/${file.replace(/\.tsx?$/, "")}";\n`;
plugins += `[${mod}.name]:${mod},\n`; plugins += `[${mod}.name]:${mod},\n`;