mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00

* feat: add a headless extension template * feat: add headless template support for create-kunkun package * chore: bump create-kunkun version to 0.1.38
19 lines
606 B
TypeScript
19 lines
606 B
TypeScript
import path from "path"
|
|
import { fileURLToPath } from "url"
|
|
import { version } from "../package.json"
|
|
|
|
export const NODE_ENV = process.env.NODE_ENV ?? "development"
|
|
export const isProduction = NODE_ENV === "production"
|
|
export function getRootDir() {
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = path.dirname(__filename)
|
|
return isProduction ? __dirname : path.dirname(__dirname)
|
|
}
|
|
export function getTemplateRoot() {
|
|
return isProduction
|
|
? path.join(getRootDir(), "templates")
|
|
: path.join(getRootDir(), "../../packages/templates")
|
|
}
|
|
|
|
export const createKunkunVersion = version
|