-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
33 lines (30 loc) · 808 Bytes
/
config.js
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
32
33
import path from 'node:path'
import { loadConfig } from 'unconfig'
import { getMyPackageJson, getPackageJson } from './lib.js'
export const myPkg = getMyPackageJson('./package.json')
export const pkg = getPackageJson()
export const cfg = {
assetsDir: 'assets',
envPrefix: 'APP_',
envDataKey: 'APP_DATA',
envConfigKey: 'APP_CONFIG'
}
export const { config, sources } = await loadConfig({
sources: [
{
files: path.resolve(path.join(process.cwd(), 'htmlcssjs.config')),
extensions: ['js', 'mjs', 'ts']
},
{
files: path.resolve(
path.join(process.cwd(), 'node_modules', myPkg.name, 'htmlcssjs.config')
),
extensions: ['js', 'mjs', 'ts']
},
{
files: 'htmlcssjs.config',
extensions: ['js', 'mjs', 'ts']
}
],
merge: true
})