build: add precompiled CLI distribution
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { existsSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
const directory = path.dirname(fileURLToPath(import.meta.url));
|
||||
const bundledTheme = path.resolve(directory, '..', 'theme');
|
||||
const workspaceTheme = path.resolve(directory, '..', '..', 'packages', 'slidev-theme-easy-jyy');
|
||||
export function resolveTheme(theme) {
|
||||
if (theme)
|
||||
return theme;
|
||||
if (existsSync(path.join(bundledTheme, 'package.json')))
|
||||
return bundledTheme;
|
||||
if (existsSync(path.join(workspaceTheme, 'package.json')))
|
||||
return workspaceTheme;
|
||||
throw new Error('easy-slides 主题不存在;请重新安装或构建 @easy-slides/cli');
|
||||
}
|
||||
//# sourceMappingURL=theme.js.map
|
||||
Reference in New Issue
Block a user