Skip to content

Commit c464f51

Browse files
yamanokuclaude
andauthored
サイト生成後のアセットパスを読み込めるように修正 (#342)
* サイト生成後のアセットパスを読み込めるように修正 * fix: Netlify環境でNitroプリセットを明示的にserverに固定 Netlify環境ではNITRO環境変数により自動的にnetlifyプリセットが検知・使用され、 ビルド出力先が .output/public/ から .netlify/functions-internal/ に変わってしまう。 NITRO_PRESET=server を明示することでローカルと同じ挙動にし、 renameDir.js が参照する .output/public/ が正しく生成されるようにする。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fda14f4 commit c464f51

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
command = "npm run generate"
33
publish = "dist"
44

5+
[build.environment]
6+
NITRO_PRESET = "server"
7+
58
[[redirects]]
69
from = "/2022/*"
710
to = "/2022/index.html"

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineNuxtConfig({
1111
base: '/2022/',
1212
},
1313
app: {
14-
buildAssetsDir: '/_nuxt/',
14+
buildAssetsDir: '_nuxt/',
1515
baseURL: isProd ? '/2022/' : '/',
1616
},
1717

0 commit comments

Comments
 (0)