chore: consolidate development into the primary workspace
This commit is contained in:
@@ -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;
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user