Improve import alias

@file/ and @export/ instead of file/ and export/ etc
This commit is contained in:
Dolan Miu
2022-06-26 23:26:42 +01:00
parent c19bc6b4b3
commit 982d923553
380 changed files with 758 additions and 521 deletions

View File

@ -6,9 +6,9 @@ const files = glob.sync("build/**/*.d.ts");
for (const file of files) {
replaceInFile({
files: file,
from: /"file[a-z/-]*"/gi,
from: /"@[a-z/-]*"/gi,
to: (match) => {
const matchSlug = match.replace(/['"]+/g, "").trim();
const matchSlug = match.replace(/['"]+/g, "").replace(/[@]+/g, "").trim();
const levelCount = file.split("/").length - 2;
const backLevels = Array(levelCount).fill("../").join("");