mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-04 14:19:19 +00:00
修复path文件被ide吃掉的问题
This commit is contained in:
parent
45592a1852
commit
ed225322a5
26
constants/path.js
Normal file
26
constants/path.js
Normal file
@ -0,0 +1,26 @@
|
||||
import path from 'path';
|
||||
import url from 'url';
|
||||
import fs from 'fs';
|
||||
|
||||
const __filename = url.fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const rootDir = path.join(__dirname, '..');
|
||||
|
||||
const Path = {
|
||||
root: rootDir,
|
||||
apps: path.join(rootDir, 'apps'),
|
||||
components: path.join(rootDir, 'components'),
|
||||
defaultConfig: path.join(rootDir, 'config/default.json'),
|
||||
config: path.resolve(rootDir, '../../data/crystelf'),
|
||||
constants: path.join(rootDir, 'constants'),
|
||||
lib: path.join(rootDir, 'lib'),
|
||||
models: path.join(rootDir, 'models'),
|
||||
index: path.join(rootDir, 'index.js'),
|
||||
pkg: path.join(rootDir, 'package.json'),
|
||||
yunzai: path.join(rootDir, '../../'),
|
||||
};
|
||||
|
||||
const configFile = fs.readFileSync(Path.defaultConfig, 'utf8');
|
||||
export const defaultConfig = JSON.parse(configFile);
|
||||
|
||||
export default Path;
|
5
constants/relativelyPath.js
Normal file
5
constants/relativelyPath.js
Normal file
@ -0,0 +1,5 @@
|
||||
const relativelyPath = {
|
||||
config: '/data/crystelf/config.json',
|
||||
};
|
||||
|
||||
export default relativelyPath;
|
Loading…
x
Reference in New Issue
Block a user