Skip to content

Commit afb2c64

Browse files
Update Netlify and Astro configuration for better deployment
1 parent ab66a65 commit afb2c64

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

astro.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default defineConfig({
2323
site: config.site.base_url ? config.site.base_url : "http://examplesite.com",
2424
base: config.site.base_path ? config.site.base_path : "/",
2525
trailingSlash: config.site.trailing_slash ? "always" : "ignore",
26+
output: "static",
2627
i18n: {
2728
locales: filteredSupportedLang,
2829
defaultLocale: default_language,
@@ -65,4 +66,13 @@ export default defineConfig({
6566
},
6667
extendDefaultPlugins: true,
6768
},
69+
vite: {
70+
build: {
71+
sourcemap: false,
72+
minify: true,
73+
},
74+
ssr: {
75+
noExternal: ['@astrojs/*'],
76+
},
77+
},
6878
});

netlify.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[build]
22
publish = "dist"
3-
command = "yarn generate-json && yarn build"
3+
command = "yarn install && yarn generate-json && yarn build"
44

55
[build.environment]
66
NODE_VERSION = "20"
77
DEBUG = "*"
8+
NODE_ENV = "production"
9+
YARN_FLAGS = "--frozen-lockfile"
810

911
[[plugins]]
1012
package = "@netlify/plugin-functions-core"
@@ -13,3 +15,8 @@ package = "@netlify/plugin-functions-core"
1315

1416
[functions]
1517
node_bundler = "esbuild"
18+
19+
[[redirects]]
20+
from = "/*"
21+
to = "/index.html"
22+
status = 200

0 commit comments

Comments
 (0)