1
0
forked from noxious/server

Path fixes for all environments, npm run format, removed redundant imports

This commit is contained in:
2024-10-01 00:10:30 +02:00
parent 4cbd62cbb0
commit ce1708a55e
24 changed files with 82 additions and 87 deletions

View File

@ -0,0 +1,15 @@
import config from './config'
import path from 'path'
export function getRootPath(folder: string, ...additionalSegments: string[]) {
return path.join(process.cwd(), folder, ...additionalSegments)
}
export function getAppPath(folder: string, ...additionalSegments: string[]) {
const baseDir = config.ENV === 'development' ? 'src' : 'dist'
return path.join(process.cwd(), baseDir, folder, ...additionalSegments)
}
export function getPublicPath(folder: string, ...additionalSegments: string[]) {
return path.join(process.cwd(), 'public', folder, ...additionalSegments)
}