-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.js
More file actions
31 lines (27 loc) · 789 Bytes
/
Copy pathconfig.js
File metadata and controls
31 lines (27 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os from 'node:os';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
const configPath = resolve(process.cwd(), 'ektest.config.json');
const userConfig = (() => {
try {
return JSON.parse(readFileSync(configPath, 'utf-8'));
} catch (error) {
if (error.code === 'ENOENT') {
return {};
}
throw error;
}
})();
export const LIB_DIR = `${os.tmpdir()}/ektest`;
export const BUILD_DIR = resolve(LIB_DIR, 'build');
export const BUNDLER = userConfig.bundler || 'webpack';
export const BUNDLER_CONFIG_PATH = userConfig.bundlerConfigPath;
export let testDir = userConfig.testDir ? resolve(process.cwd(), userConfig.testDir) : '';
export default {
set testDir(dir) {
testDir = dir;
},
get testDir() {
return testDir;
},
}