Archived
feat: bundle workspace tasks plugin
This commit is contained in:
@@ -40,7 +40,7 @@ async function buildDirectory(sourceDir, targetDir) {
|
||||
}
|
||||
|
||||
if (!entry.isFile()) continue;
|
||||
if (entry.name.endsWith(".d.ts")) continue;
|
||||
if (entry.name.endsWith(".d.ts") || isTestSource(entry.name)) continue;
|
||||
|
||||
if (isPluginSource(entry.name)) {
|
||||
await buildFile(sourcePath, targetPath.replace(/\.ts$/u, ".js"));
|
||||
@@ -94,6 +94,10 @@ function isPluginSource(fileName) {
|
||||
return fileName.endsWith(".ts") && !fileName.endsWith(".d.ts");
|
||||
}
|
||||
|
||||
function isTestSource(fileName) {
|
||||
return /\.(?:test|spec)\.ts$/u.test(fileName);
|
||||
}
|
||||
|
||||
async function hasTypeScriptSource(javaScriptPath) {
|
||||
const typeScriptPath = javaScriptPath.replace(/\.js$/u, ".ts");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user