Improve import alias
@file/ and @export/ instead of file/ and export/ etc
This commit is contained in:
@ -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("");
|
||||
|
||||
|
Reference in New Issue
Block a user