chore: consolidate development into the primary workspace

This commit is contained in:
maoyingjie
2026-10-25 21:39:20 +08:00
parent 1f96ea3719
commit 2af7ea1225
11 changed files with 85 additions and 8 deletions
+9 -5
View File
@@ -17,11 +17,15 @@ export default defineConfig({
content: content.replace(
/((?:from\s+|import\s*\(\s*)["'])(\.{1,2}\/[^"']+)(["'])/g,
(_match, prefix: string, path: string, suffix: string) => {
const target = /\.(?:[cm]?js|json|css)$/.test(path)
? path
: /\.ts$/.test(path)
? path.slice(0, -3) + ".js"
: path + ".js";
// TS may infer a barrel import such as import('../..').
// Appending '.js' would produce the invalid path '../...js'.
const target = /(?:^|\/)\.{1,2}\/?$/.test(path)
? path.replace(/\/$/, "") + "/index.js"
: /\.(?:[cm]?js|json|css)$/.test(path)
? path
: /\.ts$/.test(path)
? path.slice(0, -3) + ".js"
: path + ".js";
return prefix + target + suffix;
},
),