mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
initial upload
This commit is contained in:
commit
1c65f10e24
58 changed files with 2533 additions and 0 deletions
29
lib/path.js
Normal file
29
lib/path.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
// 获取当前模块的 URL
|
||||
const metaUrl = import.meta.url;
|
||||
|
||||
// 将 URL 转换为文件路径
|
||||
const metaPath = fileURLToPath(new URL(metaUrl));
|
||||
|
||||
// 插件路径
|
||||
export const pluginPath = path.join(metaPath, '../../');
|
||||
|
||||
// 插件名
|
||||
export const pluginName = path.basename(pluginPath);
|
||||
|
||||
// apps 路径
|
||||
export const appPath = path.join(pluginPath, 'apps');
|
||||
|
||||
// resources
|
||||
export const resourcesPath = path.join(pluginPath, 'resources');
|
||||
|
||||
// config 路径
|
||||
export const configPath = path.join(pluginPath, 'config');
|
||||
|
||||
// 默认配置路径
|
||||
export const defPath = path.join(pluginPath, 'defSet');
|
||||
|
||||
// data 路径
|
||||
export const dataPath = path.join(pluginPath, 'data');
|
||||
Loading…
Add table
Add a link
Reference in a new issue