fix(M06-R): 修复静态检查路径兼容
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = new URL('..', import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1');
|
||||
const root = fileURLToPath(new URL('..', import.meta.url));
|
||||
const read = (path) => readFileSync(join(root, path), 'utf8');
|
||||
|
||||
const packageJson = JSON.parse(read('admin/package.json'));
|
||||
|
||||
Reference in New Issue
Block a user