diff --git a/.gitignore b/.gitignore index 651cd56..2d3ca80 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ List/ip/china_ip.conf List/non_ip/1stream.conf index.html node_modules -.DS_Store \ No newline at end of file +.DS_Store +dist \ No newline at end of file diff --git a/src/build/build-public.ts b/src/build/build-public.ts index 60d6676..95b3916 100644 --- a/src/build/build-public.ts +++ b/src/build/build-public.ts @@ -1,6 +1,6 @@ import * as fs from 'node:fs/promises'; -import { walkDir, generateHtml } from '../utils/utils'; -import { TreeEntry } from '../types'; +import { walkDir, generateHtml } from '@utils/utils'; +import { TreeEntry } from '@utils/types'; export async function buildPublic(): Promise { try { diff --git a/src/types.ts b/src/utils/types.ts similarity index 100% rename from src/types.ts rename to src/utils/types.ts diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 6673ed7..1911bc6 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,6 +1,6 @@ import * as fs from 'node:fs/promises'; import * as path from 'node:path'; -import { TreeEntry } from '../types'; +import { TreeEntry } from './types'; // Priority Sorter const priorityOrder: { [key: string]: number } = { diff --git a/tsconfig.json b/tsconfig.json index 44dc3fb..6d2c501 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,10 +11,11 @@ "allowJs": true, "outDir": "dist", "resolveJsonModule": true, - "baseUrl": "./src", // 添加这一行 + "baseUrl": "./src", "paths": { - "*": ["*"] // 添加这一行 + "*": ["*"], + "@utils/*": ["utils/*"] } }, - "include": ["src/**/*"] // 添加这一行,指定需要编译的文件 + "include": ["src/**/*"] }