diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-14 00:24:19 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-14 00:24:19 +0000 |
| commit | 6072e6c583dd9122ba670db555a075654a852e62 (patch) | |
| tree | ead89df29d1efb2a9f60b4bed8dec41ce9b38050 /nuxt.config.ts | |
| parent | e1ff3b44a55349dad8c07de690ca86c984c91469 (diff) | |
Move git hash fetch to nuxt-prepare
Diffstat (limited to 'nuxt.config.ts')
| -rw-r--r-- | nuxt.config.ts | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/nuxt.config.ts b/nuxt.config.ts index db228a9..f748dc2 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,5 +1,3 @@ -import { execSync } from "child_process"; - export default defineNuxtConfig({ components: [ { path: '~/components', pathPrefix: true }, @@ -11,6 +9,7 @@ export default defineNuxtConfig({ modules: [ // ... '@pinia/nuxt', + 'nuxt-prepare' ], css: [ '@fortawesome/fontawesome-svg-core/styles.css' @@ -23,17 +22,6 @@ export default defineNuxtConfig({ "@fortawesome/free-regular-svg-icons", ], }, - hooks: { - "build:before": () => { - const gitCommitHash = execSync('git rev-parse HEAD').toString().trim(); - const gitCommitHashShort = gitCommitHash.slice(0, 8); - const gitBranch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); - - process.env.GIT_COMMIT_HASH = gitCommitHash; - process.env.GIT_COMMIT_HASH_SHORT = gitCommitHashShort; - process.env.GIT_BRANCH = gitBranch; - } - }, runtimeConfig: { public: { gitCommitHash: process.env.GIT_COMMIT_HASH, |
