Skip to content

Commit 7e0bee9

Browse files
Optimize build configuration for Netlify deployment
1 parent afb2c64 commit 7e0bee9

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

astro.config.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export default defineConfig({
2424
base: config.site.base_path ? config.site.base_path : "/",
2525
trailingSlash: config.site.trailing_slash ? "always" : "ignore",
2626
output: "static",
27+
build: {
28+
format: 'directory',
29+
assets: '_assets',
30+
},
2731
i18n: {
2832
locales: filteredSupportedLang,
2933
defaultLocale: default_language,
@@ -70,9 +74,14 @@ export default defineConfig({
7074
build: {
7175
sourcemap: false,
7276
minify: true,
77+
rollupOptions: {
78+
output: {
79+
manualChunks: undefined,
80+
},
81+
},
7382
},
74-
ssr: {
75-
noExternal: ['@astrojs/*'],
83+
optimizeDeps: {
84+
exclude: ['@astrojs/mdx'],
7685
},
7786
},
7887
});

netlify.toml

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

55
[build.environment]
66
NODE_VERSION = "20"
7-
DEBUG = "*"
87
NODE_ENV = "production"
98
YARN_FLAGS = "--frozen-lockfile"
109

11-
[[plugins]]
12-
package = "@netlify/plugin-functions-core"
13-
[plugins.inputs]
14-
functionsDirectory = "netlify/functions"
15-
16-
[functions]
17-
node_bundler = "esbuild"
18-
1910
[[redirects]]
2011
from = "/*"
2112
to = "/index.html"
2213
status = 200
14+
15+
[[headers]]
16+
for = "/*"
17+
[headers.values]
18+
X-Frame-Options = "DENY"
19+
X-XSS-Protection = "1; mode=block"
20+
X-Content-Type-Options = "nosniff"
21+
Referrer-Policy = "strict-origin-when-cross-origin"

0 commit comments

Comments
 (0)