From 73ee9689ae0114d0b4f3779b2c26e58b97900bd0 Mon Sep 17 00:00:00 2001 From: Kevin Marrec Date: Fri, 22 Jul 2022 18:04:31 +0200 Subject: [PATCH] fix(manifest): move server handler to runtime Closes #22 --- package.json | 5 ++++- src/parts/manifest/index.ts | 2 +- .../manifest/handler.ts => runtime/server/manifest.ts} | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) rename src/{parts/manifest/handler.ts => runtime/server/manifest.ts} (77%) diff --git a/package.json b/package.json index 2a0b856..cf01c8a 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,11 @@ }, "build": { "externals": [ + "node:child_process", + "node:fs", "consola", - "pathe" + "pathe", + "ufo" ] }, "packageManager": "pnpm@7.5.0" diff --git a/src/parts/manifest/index.ts b/src/parts/manifest/index.ts index 460f1c6..92b9757 100644 --- a/src/parts/manifest/index.ts +++ b/src/parts/manifest/index.ts @@ -11,7 +11,7 @@ export default (pwa: PWAContext) => { addServerHandler({ route: '/manifest.json', - handler: pwa._resolver.resolve('./parts/manifest/handler') + handler: pwa._resolver.resolve('./runtime/server/manifest') }) pwa._manifestMeta = { diff --git a/src/parts/manifest/handler.ts b/src/runtime/server/manifest.ts similarity index 77% rename from src/parts/manifest/handler.ts rename to src/runtime/server/manifest.ts index ebe13ed..15760c3 100644 --- a/src/parts/manifest/handler.ts +++ b/src/runtime/server/manifest.ts @@ -1,4 +1,5 @@ import { defineEventHandler } from 'h3' +import { useRuntimeConfig } from '#imports' export default defineEventHandler(() => { const { pwaManifest } = useRuntimeConfig()