[build]
  publish = "dist/"
  command = "pnpm run netlify-build"


# https://docs.netlify.com/configure-builds/file-based-configuration/#functions
[functions]
    # Sets a custom directory for Netlify Functions
    directory = "dist/functions"

    # Specifies `esbuild` for functions bundling
    # node_bundler = "esbuild"

    # Flags "astro" as an external node module for all functions
    # external_node_modules = ["astro"]

    # Includes all Markdown files inside the "files/" directory.
    # included_files = ["files/*.md"]

# Astro Entry function
[functions."entry"]
    # https://www.netlify.com/blog/2021/08/12/how-to-include-files-in-netlify-serverless-functions/
    included_files = ["netlify.toml"]



[build.environment]
  NPM_FLAGS = "--no-optional"
  CI = "1"

[[headers]]
    for = "/search-index.st"
    [headers.values]
        Content-Type = "application/wasm"
        Cache-Control = "max-age=43200, must-revalidate"

# https://docs.netlify.com/configure-builds/file-based-configuration/#redirects
# These redirect are lower priority than _redirects in the root or dist
# old node redirect
[[redirects]]
  from = "/app/node"
  to = "/app/nodejs"
  status = 301

# old git redirect
[[redirects]]
  from = "/app/git"
  to = "/app/git-version-control"
  status = 301

# old electron redirect
[[redirects]]
  from = "/app/electron"
  to = "/app/electron-framework"
  status = 301

# Vectornater rebrand to Linearity Curve
[[redirects]]
  from = "/app/vectornator"
  to = "/app/linearity-curve"
  status = 301


# imac redirect
[[redirects]]
  from = "/device/apple-silicon-imac"
  to = "/device/m1-imac/"
  status = 307


# Category Redirects
[[redirects]]
  from = "/kind/entertainment"
  to = "/kind/entertainment-and-media-apps/"
  status = 301

[[redirects]]
  from = "/kind/photo-tools"
  to = "/kind/photo-and-graphic-tools/"
  status = 301


 # Other Redirects

# Random broken link from Chinese sites
[[redirects]]
  from = "/。"
  to = "/"
  status = 301

[[redirects]]
  from = "/%E3%80%82"
  to = "/"
  status = 301
