From 808893a5f08038dc1b6ab0c40a8f953421296e2f Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 7 Aug 2024 12:18:36 -0500 Subject: [PATCH] Switched to using hooks to copy ving.json to the build directory. --- nuxt.config.mjs | 10 ++++++++-- package.json | 2 +- ving/docs/change-log.md | 7 +++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/nuxt.config.mjs b/nuxt.config.mjs index 4c6394ec..67479c64 100644 --- a/nuxt.config.mjs +++ b/nuxt.config.mjs @@ -1,7 +1,7 @@ // https://nuxt.com/docs/api/configuration/nuxt-config import ving from './ving.json'; -//import VingTheme from './themes/ving-theme.mjs'; -import Aura from '@primevue/themes/aura'; +import { cpSync } from 'node:fs'; +import path from 'node:path'; ving.site.url = process.env.VING_SITE_URL; @@ -75,4 +75,10 @@ export default defineNuxtConfig({ runtimeConfig: { public: ving, }, + hooks: { + 'nitro:build:public-assets': (nitro) => { + const targetPath = path.join(nitro.options.output.dir, 'ving.json'); + cpSync('./ving.json', targetPath, { recursive: true }); + } + } }) \ No newline at end of file diff --git a/package.json b/package.json index ff66e1be..00255f93 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "#ving/*": "./ving/*" }, "scripts": { - "build": "nuxt build && cp ./ving.json .output/", + "build": "nuxt build", "dev": "nuxt dev --host", "generate": "nuxt generate", "preview": "nuxt preview", diff --git a/ving/docs/change-log.md b/ving/docs/change-log.md index 4e13a1fb..1de422f5 100644 --- a/ving/docs/change-log.md +++ b/ving/docs/change-log.md @@ -5,13 +5,16 @@ outline: deep ## August 2024 +### 2024-08-07 +* Switched to using hooks to copy ving.json to the build directory. + ### 2024-08-05 - * Added redis to Pulumi prod. +* Added redis to Pulumi prod. ### 2024-08-02 * Added Pulumi prod. * Pulumi prod creates a VPC. -* Pulumi prod creates a a database cluster. +* Pulumi prod creates a database cluster. ## July 2024