@depup/nitro 3.0.260311-beta-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +32 -0
- package/changes.json +14 -0
- package/dist/THIRD-PARTY-LICENSES.md +1646 -0
- package/dist/_build/common.mjs +29361 -0
- package/dist/_build/rolldown.mjs +173 -0
- package/dist/_build/rollup.mjs +194 -0
- package/dist/_build/vite.build.mjs +18 -0
- package/dist/_chunks/nitro.mjs +1159 -0
- package/dist/_chunks/nitro2.mjs +102 -0
- package/dist/_chunks/nitro3.mjs +129 -0
- package/dist/_chunks/utils.mjs +272 -0
- package/dist/_common.mjs +35 -0
- package/dist/_dev.d.mts +12 -0
- package/dist/_dev.mjs +519 -0
- package/dist/_libs/_.mjs +3 -0
- package/dist/_libs/_2.mjs +2 -0
- package/dist/_libs/_3.mjs +3 -0
- package/dist/_libs/_4.mjs +2 -0
- package/dist/_libs/_5.mjs +3 -0
- package/dist/_libs/_6.mjs +4 -0
- package/dist/_libs/_7.mjs +5 -0
- package/dist/_libs/c12+rc9.mjs +812 -0
- package/dist/_libs/c12+readdirp+chokidar.d.mts +230 -0
- package/dist/_libs/citty.mjs +361 -0
- package/dist/_libs/commondir+is-reference.mjs +1311 -0
- package/dist/_libs/compatx.d.mts +47 -0
- package/dist/_libs/compatx.mjs +45 -0
- package/dist/_libs/esbuild.d.mts +20 -0
- package/dist/_libs/escape-string-regexp.mjs +7 -0
- package/dist/_libs/estree+pluginutils.d.mts +241 -0
- package/dist/_libs/estree-walker.mjs +184 -0
- package/dist/_libs/exsolve.d.mts +1 -0
- package/dist/_libs/hasown+resolve+deepmerge.mjs +1949 -0
- package/dist/_libs/httpxy.d.mts +82 -0
- package/dist/_libs/httpxy.mjs +671 -0
- package/dist/_libs/js-tokens.d.mts +1 -0
- package/dist/_libs/klona.mjs +37 -0
- package/dist/_libs/magic-string.d.mts +220 -0
- package/dist/_libs/mlly.d.mts +57 -0
- package/dist/_libs/nypm+tinyexec.mjs +845 -0
- package/dist/_libs/perfect-debounce.mjs +88 -0
- package/dist/_libs/pkg-types.d.mts +23 -0
- package/dist/_libs/plugin-alias.mjs +64 -0
- package/dist/_libs/plugin-inject.mjs +131 -0
- package/dist/_libs/plugin-json.mjs +34 -0
- package/dist/_libs/pluginutils.mjs +646 -0
- package/dist/_libs/readdirp+chokidar.mjs +1606 -0
- package/dist/_libs/remapping.mjs +115 -0
- package/dist/_libs/resolve-uri+gen-mapping.mjs +442 -0
- package/dist/_libs/rou3.d.mts +44 -0
- package/dist/_libs/rou3.mjs +496 -0
- package/dist/_libs/std-env.d.mts +12 -0
- package/dist/_libs/strip-literal.d.mts +1 -0
- package/dist/_libs/tsconfck.mjs +813 -0
- package/dist/_libs/ultrahtml.mjs +127 -0
- package/dist/_libs/unimport+unplugin.mjs +1684 -0
- package/dist/_libs/unplugin+unimport.d.mts +423 -0
- package/dist/_libs/unwasm.d.mts +29 -0
- package/dist/_presets.mjs +1759 -0
- package/dist/builder.d.mts +64 -0
- package/dist/builder.mjs +15 -0
- package/dist/cli/_chunks/build.mjs +47 -0
- package/dist/cli/_chunks/common.mjs +14 -0
- package/dist/cli/_chunks/deploy.mjs +40 -0
- package/dist/cli/_chunks/dev.mjs +62 -0
- package/dist/cli/_chunks/docs.mjs +30 -0
- package/dist/cli/_chunks/list.mjs +25 -0
- package/dist/cli/_chunks/prepare.mjs +17 -0
- package/dist/cli/_chunks/preview.mjs +51 -0
- package/dist/cli/_chunks/run.mjs +53 -0
- package/dist/cli/_chunks/task.mjs +14 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +22 -0
- package/dist/node_modules/@poppinss/colors/build/index.js +139 -0
- package/dist/node_modules/@poppinss/colors/package.json +118 -0
- package/dist/node_modules/@poppinss/dumper/build/chunk-26HALFTP.js +602 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/console/main.js +441 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +725 -0
- package/dist/node_modules/@poppinss/dumper/package.json +122 -0
- package/dist/node_modules/@poppinss/exception/build/index.js +44 -0
- package/dist/node_modules/@poppinss/exception/package.json +109 -0
- package/dist/node_modules/@sindresorhus/is/distribution/index.js +1354 -0
- package/dist/node_modules/@sindresorhus/is/distribution/utilities.js +3 -0
- package/dist/node_modules/@sindresorhus/is/package.json +81 -0
- package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -0
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -0
- package/dist/node_modules/@speed-highlight/core/package.json +94 -0
- package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
- package/dist/node_modules/cookie-es/package.json +37 -0
- package/dist/node_modules/croner/dist/croner.js +1 -0
- package/dist/node_modules/croner/package.json +73 -0
- package/dist/node_modules/defu/dist/defu.mjs +69 -0
- package/dist/node_modules/defu/package.json +43 -0
- package/dist/node_modules/destr/dist/index.mjs +72 -0
- package/dist/node_modules/destr/package.json +47 -0
- package/dist/node_modules/error-stack-parser-es/dist/index.mjs +38 -0
- package/dist/node_modules/error-stack-parser-es/dist/lite.mjs +167 -0
- package/dist/node_modules/error-stack-parser-es/package.json +83 -0
- package/dist/node_modules/get-port-please/dist/index.mjs +430 -0
- package/dist/node_modules/get-port-please/package.json +39 -0
- package/dist/node_modules/kleur/index.mjs +110 -0
- package/dist/node_modules/kleur/package.json +51 -0
- package/dist/node_modules/rendu/dist/index.mjs +380 -0
- package/dist/node_modules/rendu/package.json +47 -0
- package/dist/node_modules/scule/dist/index.mjs +80 -0
- package/dist/node_modules/scule/package.json +43 -0
- package/dist/node_modules/source-map/lib/array-set.js +100 -0
- package/dist/node_modules/source-map/lib/base64-vlq.js +94 -0
- package/dist/node_modules/source-map/lib/base64.js +19 -0
- package/dist/node_modules/source-map/lib/binary-search.js +113 -0
- package/dist/node_modules/source-map/lib/mapping-list.js +83 -0
- package/dist/node_modules/source-map/lib/mappings.wasm +0 -0
- package/dist/node_modules/source-map/lib/read-wasm.js +27 -0
- package/dist/node_modules/source-map/lib/source-map-consumer.js +1081 -0
- package/dist/node_modules/source-map/lib/source-map-generator.js +439 -0
- package/dist/node_modules/source-map/lib/source-node.js +430 -0
- package/dist/node_modules/source-map/lib/url.js +13 -0
- package/dist/node_modules/source-map/lib/util.js +444 -0
- package/dist/node_modules/source-map/lib/wasm.js +138 -0
- package/dist/node_modules/source-map/package.json +79 -0
- package/dist/node_modules/source-map/source-map.js +10 -0
- package/dist/node_modules/supports-color/index.js +202 -0
- package/dist/node_modules/supports-color/package.json +64 -0
- package/dist/node_modules/ufo/dist/index.mjs +645 -0
- package/dist/node_modules/ufo/package.json +48 -0
- package/dist/node_modules/unctx/dist/index.mjs +131 -0
- package/dist/node_modules/unctx/package.json +67 -0
- package/dist/node_modules/youch/build/helpers-B9BQYaS6.js +23 -0
- package/dist/node_modules/youch/build/index.js +212 -0
- package/dist/node_modules/youch/build/public/error_cause/style.css +5 -0
- package/dist/node_modules/youch/build/public/error_info/script.js +13 -0
- package/dist/node_modules/youch/build/public/error_info/style.css +145 -0
- package/dist/node_modules/youch/build/public/error_metadata/style.css +3 -0
- package/dist/node_modules/youch/build/public/error_stack/script.js +72 -0
- package/dist/node_modules/youch/build/public/error_stack/style.css +219 -0
- package/dist/node_modules/youch/build/public/error_stack_source/style.css +123 -0
- package/dist/node_modules/youch/build/public/header/script.js +14 -0
- package/dist/node_modules/youch/build/public/header/style.css +56 -0
- package/dist/node_modules/youch/build/public/layout/script.js +12 -0
- package/dist/node_modules/youch/build/public/layout/style.css +435 -0
- package/dist/node_modules/youch/build/public_dir-C5bujZKB.js +25 -0
- package/dist/node_modules/youch/build/src/templates/error_cause/main.js +44 -0
- package/dist/node_modules/youch/build/src/templates/error_info/main.js +72 -0
- package/dist/node_modules/youch/build/src/templates/error_metadata/main.js +65 -0
- package/dist/node_modules/youch/build/src/templates/error_stack/main.js +152 -0
- package/dist/node_modules/youch/build/src/templates/error_stack_source/main.js +46 -0
- package/dist/node_modules/youch/build/src/templates/header/main.js +24 -0
- package/dist/node_modules/youch/build/src/templates/layout/main.js +27 -0
- package/dist/node_modules/youch/package.json +135 -0
- package/dist/node_modules/youch-core/build/index.js +316 -0
- package/dist/node_modules/youch-core/package.json +124 -0
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +20 -0
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +15 -0
- package/dist/presets/_nitro/runtime/service-worker.mjs +23 -0
- package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +14 -0
- package/dist/presets/aws-lambda/runtime/_utils.mjs +116 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +31 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +13 -0
- package/dist/presets/azure/runtime/_utils.mjs +50 -0
- package/dist/presets/azure/runtime/azure-swa.mjs +30 -0
- package/dist/presets/bun/runtime/bun.mjs +40 -0
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +87 -0
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +72 -0
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +17 -0
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +39 -0
- package/dist/presets/cloudflare/runtime/plugin.dev.mjs +96 -0
- package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
- package/dist/presets/deno/runtime/deno-deploy.mjs +19 -0
- package/dist/presets/deno/runtime/deno-server.mjs +39 -0
- package/dist/presets/netlify/runtime/netlify-edge.mjs +20 -0
- package/dist/presets/netlify/runtime/netlify.mjs +20 -0
- package/dist/presets/node/runtime/node-cluster.mjs +54 -0
- package/dist/presets/node/runtime/node-middleware.mjs +14 -0
- package/dist/presets/node/runtime/node-server.mjs +47 -0
- package/dist/presets/standard/runtime/server.mjs +4 -0
- package/dist/presets/stormkit/runtime/stormkit.mjs +27 -0
- package/dist/presets/vercel/runtime/cron-handler.mjs +25 -0
- package/dist/presets/vercel/runtime/isr.mjs +19 -0
- package/dist/presets/vercel/runtime/vercel.node.mjs +24 -0
- package/dist/presets/vercel/runtime/vercel.web.mjs +23 -0
- package/dist/presets/winterjs/runtime/winterjs.mjs +91 -0
- package/dist/presets/zeabur/runtime/zeabur.mjs +4 -0
- package/dist/presets/zephyr/runtime/server.mjs +3 -0
- package/dist/runtime/app.d.mts +1 -0
- package/dist/runtime/app.mjs +1 -0
- package/dist/runtime/cache.d.mts +1 -0
- package/dist/runtime/cache.mjs +1 -0
- package/dist/runtime/config.d.mts +3 -0
- package/dist/runtime/config.mjs +4 -0
- package/dist/runtime/context.d.mts +1 -0
- package/dist/runtime/context.mjs +1 -0
- package/dist/runtime/database.d.mts +1 -0
- package/dist/runtime/database.mjs +1 -0
- package/dist/runtime/internal/app.d.mts +16 -0
- package/dist/runtime/internal/app.mjs +208 -0
- package/dist/runtime/internal/cache.d.mts +7 -0
- package/dist/runtime/internal/cache.mjs +41 -0
- package/dist/runtime/internal/context.d.mts +14 -0
- package/dist/runtime/internal/context.mjs +24 -0
- package/dist/runtime/internal/database.d.mts +2 -0
- package/dist/runtime/internal/database.mjs +12 -0
- package/dist/runtime/internal/empty.mjs +0 -0
- package/dist/runtime/internal/error/dev.d.mts +10 -0
- package/dist/runtime/internal/error/dev.mjs +121 -0
- package/dist/runtime/internal/error/hooks.d.mts +1 -0
- package/dist/runtime/internal/error/hooks.mjs +9 -0
- package/dist/runtime/internal/error/prod.d.mts +6 -0
- package/dist/runtime/internal/error/prod.mjs +40 -0
- package/dist/runtime/internal/error/utils.d.mts +8 -0
- package/dist/runtime/internal/error/utils.mjs +3 -0
- package/dist/runtime/internal/meta.d.mts +2 -0
- package/dist/runtime/internal/meta.mjs +3 -0
- package/dist/runtime/internal/plugin.d.mts +3 -0
- package/dist/runtime/internal/plugin.mjs +4 -0
- package/dist/runtime/internal/route-rules.d.mts +9 -0
- package/dist/runtime/internal/route-rules.mjs +72 -0
- package/dist/runtime/internal/routes/dev-tasks.d.mts +3 -0
- package/dist/runtime/internal/routes/dev-tasks.mjs +25 -0
- package/dist/runtime/internal/routes/openapi.d.mts +3 -0
- package/dist/runtime/internal/routes/openapi.mjs +94 -0
- package/dist/runtime/internal/routes/renderer-template.d.mts +2 -0
- package/dist/runtime/internal/routes/renderer-template.dev.d.mts +3 -0
- package/dist/runtime/internal/routes/renderer-template.dev.mjs +19 -0
- package/dist/runtime/internal/routes/renderer-template.mjs +4 -0
- package/dist/runtime/internal/routes/scalar.d.mts +3 -0
- package/dist/runtime/internal/routes/scalar.mjs +193 -0
- package/dist/runtime/internal/routes/swagger.d.mts +3 -0
- package/dist/runtime/internal/routes/swagger.mjs +42 -0
- package/dist/runtime/internal/runtime-config.d.mts +9 -0
- package/dist/runtime/internal/runtime-config.mjs +54 -0
- package/dist/runtime/internal/static.d.mts +3 -0
- package/dist/runtime/internal/static.mjs +67 -0
- package/dist/runtime/internal/storage.d.mts +2 -0
- package/dist/runtime/internal/storage.mjs +6 -0
- package/dist/runtime/internal/task.d.mts +19 -0
- package/dist/runtime/internal/task.mjs +69 -0
- package/dist/runtime/internal/vite/dev-entry.mjs +18 -0
- package/dist/runtime/internal/vite/dev-worker.mjs +264 -0
- package/dist/runtime/internal/vite/ssr-renderer.mjs +6 -0
- package/dist/runtime/meta.d.mts +5 -0
- package/dist/runtime/meta.mjs +27 -0
- package/dist/runtime/nitro.d.mts +11 -0
- package/dist/runtime/nitro.mjs +34 -0
- package/dist/runtime/runtime-config.d.mts +1 -0
- package/dist/runtime/runtime-config.mjs +1 -0
- package/dist/runtime/storage.d.mts +1 -0
- package/dist/runtime/storage.mjs +1 -0
- package/dist/runtime/task.d.mts +1 -0
- package/dist/runtime/task.mjs +1 -0
- package/dist/runtime/virtual/_runtime_warn.d.mts +1 -0
- package/dist/runtime/virtual/_runtime_warn.mjs +5 -0
- package/dist/runtime/virtual/database.d.mts +8 -0
- package/dist/runtime/virtual/database.mjs +2 -0
- package/dist/runtime/virtual/error-handler.d.mts +6 -0
- package/dist/runtime/virtual/error-handler.mjs +9 -0
- package/dist/runtime/virtual/feature-flags.d.mts +7 -0
- package/dist/runtime/virtual/feature-flags.mjs +7 -0
- package/dist/runtime/virtual/plugins.d.mts +3 -0
- package/dist/runtime/virtual/plugins.mjs +2 -0
- package/dist/runtime/virtual/polyfills.d.mts +3 -0
- package/dist/runtime/virtual/polyfills.mjs +2 -0
- package/dist/runtime/virtual/public-assets.d.mts +9 -0
- package/dist/runtime/virtual/public-assets.mjs +8 -0
- package/dist/runtime/virtual/renderer-template.d.mts +4 -0
- package/dist/runtime/virtual/renderer-template.mjs +7 -0
- package/dist/runtime/virtual/routing-meta.d.mts +7 -0
- package/dist/runtime/virtual/routing-meta.mjs +2 -0
- package/dist/runtime/virtual/routing.d.mts +8 -0
- package/dist/runtime/virtual/routing.mjs +11 -0
- package/dist/runtime/virtual/runtime-config.d.mts +3 -0
- package/dist/runtime/virtual/runtime-config.mjs +5 -0
- package/dist/runtime/virtual/server-assets.d.mts +7 -0
- package/dist/runtime/virtual/server-assets.mjs +12 -0
- package/dist/runtime/virtual/storage.d.mts +3 -0
- package/dist/runtime/virtual/storage.mjs +5 -0
- package/dist/runtime/virtual/tasks.d.mts +10 -0
- package/dist/runtime/virtual/tasks.mjs +3 -0
- package/dist/runtime/vite.d.mts +8 -0
- package/dist/runtime/vite.mjs +9 -0
- package/dist/types/index.d.mts +3010 -0
- package/dist/types/index.mjs +1 -0
- package/dist/vite.d.mts +52 -0
- package/dist/vite.mjs +740 -0
- package/lib/h3.d.mts +1 -0
- package/lib/h3.mjs +1 -0
- package/lib/tsconfig.json +27 -0
- package/lib/vite.types.d.mts +26 -0
- package/lib/vite.types.mjs +2 -0
- package/package.json +256 -0
- package/skills/nitro/SKILL.md +10 -0
- package/skills/nitro/docs/TOC.md +83 -0
- package/skills/nitro/docs/_navigation.json +679 -0
- package/skills/nitro/docs/config/index.md +1147 -0
- package/skills/nitro/docs/deploy/index.md +64 -0
- package/skills/nitro/docs/deploy/providers/alwaysdata.md +50 -0
- package/skills/nitro/docs/deploy/providers/aws-amplify.md +81 -0
- package/skills/nitro/docs/deploy/providers/aws.md +47 -0
- package/skills/nitro/docs/deploy/providers/azure.md +72 -0
- package/skills/nitro/docs/deploy/providers/cleavr.md +33 -0
- package/skills/nitro/docs/deploy/providers/cloudflare.md +375 -0
- package/skills/nitro/docs/deploy/providers/deno-deploy.md +66 -0
- package/skills/nitro/docs/deploy/providers/digitalocean.md +46 -0
- package/skills/nitro/docs/deploy/providers/firebase.md +32 -0
- package/skills/nitro/docs/deploy/providers/flightcontrol.md +67 -0
- package/skills/nitro/docs/deploy/providers/genezio.md +67 -0
- package/skills/nitro/docs/deploy/providers/github-pages.md +68 -0
- package/skills/nitro/docs/deploy/providers/gitlab-pages.md +37 -0
- package/skills/nitro/docs/deploy/providers/heroku.md +84 -0
- package/skills/nitro/docs/deploy/providers/iis.md +38 -0
- package/skills/nitro/docs/deploy/providers/koyeb.md +109 -0
- package/skills/nitro/docs/deploy/providers/netlify.md +47 -0
- package/skills/nitro/docs/deploy/providers/platform-sh.md +37 -0
- package/skills/nitro/docs/deploy/providers/render.md +37 -0
- package/skills/nitro/docs/deploy/providers/stormkit.md +24 -0
- package/skills/nitro/docs/deploy/providers/vercel.md +179 -0
- package/skills/nitro/docs/deploy/providers/zeabur.md +19 -0
- package/skills/nitro/docs/deploy/providers/zephyr.md +99 -0
- package/skills/nitro/docs/deploy/providers/zerops.md +102 -0
- package/skills/nitro/docs/deploy/runtimes/bun.md +15 -0
- package/skills/nitro/docs/deploy/runtimes/deno.md +19 -0
- package/skills/nitro/docs/deploy/runtimes/node.md +63 -0
- package/skills/nitro/docs/docs/assets.md +166 -0
- package/skills/nitro/docs/docs/cache.md +408 -0
- package/skills/nitro/docs/docs/configuration.md +256 -0
- package/skills/nitro/docs/docs/database.md +185 -0
- package/skills/nitro/docs/docs/index.md +56 -0
- package/skills/nitro/docs/docs/lifecycle.md +204 -0
- package/skills/nitro/docs/docs/migration.md +215 -0
- package/skills/nitro/docs/docs/nightly.md +31 -0
- package/skills/nitro/docs/docs/plugins.md +164 -0
- package/skills/nitro/docs/docs/quick-start.md +110 -0
- package/skills/nitro/docs/docs/renderer.md +322 -0
- package/skills/nitro/docs/docs/routing.md +711 -0
- package/skills/nitro/docs/docs/server-entry.md +239 -0
- package/skills/nitro/docs/docs/storage.md +261 -0
- package/skills/nitro/docs/docs/tasks.md +277 -0
- package/skills/nitro/docs/examples/api-routes.md +145 -0
- package/skills/nitro/docs/examples/auto-imports.md +93 -0
- package/skills/nitro/docs/examples/cached-handler.md +81 -0
- package/skills/nitro/docs/examples/custom-error-handler.md +98 -0
- package/skills/nitro/docs/examples/database.md +157 -0
- package/skills/nitro/docs/examples/elysia.md +70 -0
- package/skills/nitro/docs/examples/express.md +78 -0
- package/skills/nitro/docs/examples/fastify.md +79 -0
- package/skills/nitro/docs/examples/hello-world.md +68 -0
- package/skills/nitro/docs/examples/hono.md +74 -0
- package/skills/nitro/docs/examples/import-alias.md +100 -0
- package/skills/nitro/docs/examples/index.md +3 -0
- package/skills/nitro/docs/examples/middleware.md +91 -0
- package/skills/nitro/docs/examples/mono-jsx.md +68 -0
- package/skills/nitro/docs/examples/nano-jsx.md +70 -0
- package/skills/nitro/docs/examples/plugins.md +91 -0
- package/skills/nitro/docs/examples/renderer.md +113 -0
- package/skills/nitro/docs/examples/runtime-config.md +97 -0
- package/skills/nitro/docs/examples/server-fetch.md +87 -0
- package/skills/nitro/docs/examples/shiki.md +198 -0
- package/skills/nitro/docs/examples/virtual-routes.md +74 -0
- package/skills/nitro/docs/examples/vite-nitro-plugin.md +79 -0
- package/skills/nitro/docs/examples/vite-rsc.md +1041 -0
- package/skills/nitro/docs/examples/vite-ssr-html.md +217 -0
- package/skills/nitro/docs/examples/vite-ssr-preact.md +247 -0
- package/skills/nitro/docs/examples/vite-ssr-react.md +226 -0
- package/skills/nitro/docs/examples/vite-ssr-solid.md +256 -0
- package/skills/nitro/docs/examples/vite-ssr-tsr-react.md +442 -0
- package/skills/nitro/docs/examples/vite-ssr-tss-react.md +444 -0
- package/skills/nitro/docs/examples/vite-ssr-vue-router.md +616 -0
- package/skills/nitro/docs/examples/vite-trpc.md +335 -0
- package/skills/nitro/docs/examples/websocket.md +282 -0
- package/skills/nitro/docs/index.md +121 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Zephyr Cloud
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to [Zephyr Cloud](https://zephyr-cloud.io).
|
|
4
|
+
|
|
5
|
+
**Preset:** `zephyr`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
Zephyr support is built into Nitro through the `zephyr` preset.
|
|
10
|
+
|
|
11
|
+
For most Zephyr-specific topics such as BYOC, cloud integrations, environments, and CI/CD authentication, refer to the [Zephyr Cloud docs](https://docs.zephyr-cloud.io).
|
|
12
|
+
|
|
13
|
+
<note>
|
|
14
|
+
|
|
15
|
+
Zephyr is a little different from most Nitro deployment providers. Instead of targeting a single hosting vendor directly, Zephyr acts as a deployment control plane on top of either Zephyr-managed infrastructure or your own cloud integrations.
|
|
16
|
+
</note>
|
|
17
|
+
|
|
18
|
+
## BYOC model
|
|
19
|
+
|
|
20
|
+
Zephyr supports a BYOC (Bring Your Own Cloud) model. In Zephyr's architecture, the control plane stays managed by Zephyr, while the data plane (workers and storage) runs in your cloud accounts.
|
|
21
|
+
|
|
22
|
+
This lets you keep Zephyr's deployment workflow while using any supported Zephyr cloud integration. See the [Zephyr BYOC docs](https://docs.zephyr-cloud.io/features/byoc) for the current list of supported providers.
|
|
23
|
+
|
|
24
|
+
## Deploy with Nitro CLI
|
|
25
|
+
|
|
26
|
+
Use Nitro's deploy command to build and upload your app to Zephyr in one step:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx nitro deploy --preset zephyr
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Nitro will upload the generated output using `zephyr-agent`. If `zephyr-agent` is missing, Nitro will prompt to install it locally and will install it automatically in CI.
|
|
33
|
+
|
|
34
|
+
## Deploy during build
|
|
35
|
+
|
|
36
|
+
Zephyr is a little different here from most Nitro providers: we recommend enabling deployment during `nitro build` and treating build as the primary deployment step.
|
|
37
|
+
|
|
38
|
+
If your CI pipeline already runs `nitro build`, enable deployment during the build step:
|
|
39
|
+
|
|
40
|
+
```ts [nitro.config.ts]
|
|
41
|
+
import { defineNitroConfig } from "nitro/config";
|
|
42
|
+
|
|
43
|
+
export default defineNitroConfig({
|
|
44
|
+
preset: "zephyr",
|
|
45
|
+
zephyr: {
|
|
46
|
+
deployOnBuild: true,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then your normal build command is enough:
|
|
52
|
+
|
|
53
|
+
<pm-run></pm-run>
|
|
54
|
+
|
|
55
|
+
After the build finishes, Nitro uploads the generated output to Zephyr, deploys it to the edge, and prints the deployment URL:
|
|
56
|
+
|
|
57
|
+
```txt
|
|
58
|
+
◐ Building [Nitro] (preset: zephyr, compatibility: YYYY-MM-DD)
|
|
59
|
+
...
|
|
60
|
+
ZEPHYR Uploaded local snapshot in 110ms
|
|
61
|
+
ZEPHYR Deployed to Zephyr's edge in 700ms.
|
|
62
|
+
ZEPHYR
|
|
63
|
+
ZEPHYR https://my-app.zephyrcloud.app
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## CI authentication
|
|
67
|
+
|
|
68
|
+
Zephyr requires an API token for non-interactive deployments. The example below uses the simpler personal-token style setup with `ZE_SECRET_TOKEN` together with `zephyr.deployOnBuild`.
|
|
69
|
+
|
|
70
|
+
```yaml [.github/workflows/deploy.yml]
|
|
71
|
+
name: Deploy with Zephyr
|
|
72
|
+
|
|
73
|
+
on:
|
|
74
|
+
push:
|
|
75
|
+
branches: [main]
|
|
76
|
+
|
|
77
|
+
jobs:
|
|
78
|
+
deploy:
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
env:
|
|
81
|
+
ZE_SECRET_TOKEN: ${{ secrets.ZEPHYR_AUTH_TOKEN }}
|
|
82
|
+
steps:
|
|
83
|
+
- uses: actions/checkout@v4
|
|
84
|
+
- uses: actions/setup-node@v4
|
|
85
|
+
with:
|
|
86
|
+
node-version: 20
|
|
87
|
+
- run: npm ci
|
|
88
|
+
- run: npm run build
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For more advanced CI/CD setups, Zephyr also documents organization-level server-token authentication using `ZE_SERVER_TOKEN`. See the [Zephyr CI/CD server token docs](https://docs.zephyr-cloud.io/features/ci-cd-server-token).
|
|
92
|
+
|
|
93
|
+
## Options
|
|
94
|
+
|
|
95
|
+
### `zephyr.deployOnBuild`
|
|
96
|
+
|
|
97
|
+
Deploy to Zephyr during `nitro build` when using the `zephyr` preset.
|
|
98
|
+
|
|
99
|
+
- Default: `false`
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Zerops
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to [Zerops](https://zerops.io).
|
|
4
|
+
|
|
5
|
+
**Preset:** `zerops`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
> [!IMPORTANT]
|
|
10
|
+
> 🚧 This preset is currently experimental.
|
|
11
|
+
|
|
12
|
+
Zerops supports deploying both static and server-side rendered apps with a simple configuration file in your project root.
|
|
13
|
+
|
|
14
|
+
## Starter templates
|
|
15
|
+
|
|
16
|
+
If you want to quckly get started with zerops and nitro you can use repositories [`zeropsio/recipe-nitro-nodejs`](https://github.com/zeropsio/recipe-nitro-nodejs) and [`zeropsio/recipe-nitro-static`](https://github.com/zeropsio/recipe-nitro-static) starter templates.
|
|
17
|
+
|
|
18
|
+
## Project setup
|
|
19
|
+
|
|
20
|
+
Projects and services can be added either through [project add wizard](https://app.zerops.io/dashboard/project-add) or imported using `zerops-project-import.yml`.
|
|
21
|
+
|
|
22
|
+
<code-group>
|
|
23
|
+
|
|
24
|
+
```yml [zerops-project-import.yml (node.js)]
|
|
25
|
+
project:
|
|
26
|
+
name: nitro-app
|
|
27
|
+
|
|
28
|
+
services:
|
|
29
|
+
- hostname: app
|
|
30
|
+
type: nodejs@20
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```yml [zerops-project-import.yml (static)]
|
|
34
|
+
project:
|
|
35
|
+
name: nitro-app
|
|
36
|
+
|
|
37
|
+
services:
|
|
38
|
+
- hostname: app
|
|
39
|
+
type: static
|
|
40
|
+
```
|
|
41
|
+
</code-group>
|
|
42
|
+
|
|
43
|
+
Then create a `zerops.yml` config in your project root:
|
|
44
|
+
|
|
45
|
+
<code-group>
|
|
46
|
+
|
|
47
|
+
```yml [zerops.yml (node.js)]
|
|
48
|
+
zerops:
|
|
49
|
+
- setup: app
|
|
50
|
+
build:
|
|
51
|
+
base: nodejs@20
|
|
52
|
+
envVariables:
|
|
53
|
+
NITRO_PRESET: zerops
|
|
54
|
+
buildCommands:
|
|
55
|
+
- pnpm i
|
|
56
|
+
- pnpm run build
|
|
57
|
+
deployFiles:
|
|
58
|
+
- .output
|
|
59
|
+
- package.json
|
|
60
|
+
- node_modules
|
|
61
|
+
run:
|
|
62
|
+
base: nodejs@20
|
|
63
|
+
ports:
|
|
64
|
+
- port: 3000
|
|
65
|
+
httpSupport: true
|
|
66
|
+
start: node .output/server/index.mjs
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```yml [zerops.yml (static)]
|
|
70
|
+
zerops:
|
|
71
|
+
- setup: app
|
|
72
|
+
build:
|
|
73
|
+
base: nodejs@20
|
|
74
|
+
envVariables:
|
|
75
|
+
NITRO_PRESET: zerops-static
|
|
76
|
+
buildCommands:
|
|
77
|
+
- pnpm i
|
|
78
|
+
- pnpm build
|
|
79
|
+
deployFiles:
|
|
80
|
+
- .zerops/output/static/~
|
|
81
|
+
run:
|
|
82
|
+
base: static
|
|
83
|
+
```
|
|
84
|
+
</code-group>
|
|
85
|
+
|
|
86
|
+
Now you can trigger the [build & deploy pipeline using the Zerops CLI](#building-deploying-your-app) or by connecting the app service with your [GitHub](https://docs.zerops.io/references/github-integration/) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository from inside the service detail.
|
|
87
|
+
|
|
88
|
+
## Build and deploy
|
|
89
|
+
|
|
90
|
+
Open [Settings > Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.
|
|
91
|
+
|
|
92
|
+
Log in using your access token with the following command:
|
|
93
|
+
|
|
94
|
+
<pm-x></pm-x>
|
|
95
|
+
|
|
96
|
+
Navigate to the root of your app (where `zerops.yml` is located) and run the following command to trigger the deploy:
|
|
97
|
+
|
|
98
|
+
<pm-x></pm-x>
|
|
99
|
+
|
|
100
|
+
Your code can be deployed automatically on each commit or a new tag by connecting the service with your [GitHub](https://docs.zerops.io/references/gitlab-integration) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository. This connection can be set up in the service detail.
|
|
101
|
+
|
|
102
|
+
<read-more></read-more>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Bun
|
|
2
|
+
|
|
3
|
+
> Run Nitro apps with Bun runtime.
|
|
4
|
+
|
|
5
|
+
**Preset:** `bun`
|
|
6
|
+
|
|
7
|
+
Nitro output is compatible with Bun runtime. While using default [Node.js](/deploy/runtimes/node) you can also run the output in bun, using `bun` preset has advantage of better optimizations.
|
|
8
|
+
|
|
9
|
+
After building with bun preset using `bun` as preset, you can run server in production using:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run ./.output/server/index.mjs
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
<read-more></read-more>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Deno
|
|
2
|
+
|
|
3
|
+
> Run Nitro apps with [Deno](https://deno.com/) runtime.
|
|
4
|
+
|
|
5
|
+
**Preset:** `deno_server`
|
|
6
|
+
|
|
7
|
+
You can build your Nitro server using Node.js to run within [Deno Runtime](https://deno.com/runtime) in a custom server.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Build with the deno NITRO preset
|
|
11
|
+
NITRO_PRESET=deno_server npm run build
|
|
12
|
+
|
|
13
|
+
# Start production server
|
|
14
|
+
deno run --unstable --allow-net --allow-read --allow-env .output/server/index.ts
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Deno Deploy
|
|
18
|
+
|
|
19
|
+
<read-more></read-more>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Node.js
|
|
2
|
+
|
|
3
|
+
> Run Nitro apps with Node.js runtime.
|
|
4
|
+
|
|
5
|
+
**Preset:** `node_server`
|
|
6
|
+
|
|
7
|
+
Node.js is the default nitro output preset for production builds and Nitro has native Node.js runtime support.
|
|
8
|
+
|
|
9
|
+
Build project using nitro CLI:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
nitro build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
When running `nitro build` with the Node server preset, the result will be an entry point that launches a ready-to-run Node server. To try output:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
$ node .output/server/index.mjs
|
|
19
|
+
Listening on http://localhost:3000
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
You can now deploy fully standalone `.output` directory to the hosting of your choice.
|
|
23
|
+
|
|
24
|
+
### Environment Variables
|
|
25
|
+
|
|
26
|
+
You can customize server behavior using following environment variables:
|
|
27
|
+
|
|
28
|
+
- `NITRO_PORT` or `PORT` (defaults to `3000`)
|
|
29
|
+
- `NITRO_HOST` or `HOST`
|
|
30
|
+
- `NITRO_UNIX_SOCKET` - if provided (a path to the desired socket file) the service will be served over the provided UNIX socket.
|
|
31
|
+
- `NITRO_SSL_CERT` and `NITRO_SSL_KEY` - if both are present, this will launch the server in HTTPS mode. In the vast majority of cases, this should not be used other than for testing, and the Nitro server should be run behind a reverse proxy like nginx or Cloudflare which terminates SSL.
|
|
32
|
+
- `NITRO_SHUTDOWN_DISABLED` - Disables the graceful shutdown feature when set to `'true'`. If it's set to `'true'`, the graceful shutdown is bypassed to speed up the development process. Defaults to `'false'`.
|
|
33
|
+
- `NITRO_SHUTDOWN_SIGNALS` - Allows you to specify which signals should be handled. Each signal should be separated with a space. Defaults to `'SIGINT SIGTERM'`.
|
|
34
|
+
- `NITRO_SHUTDOWN_TIMEOUT` - Sets the amount of time (in milliseconds) before a forced shutdown occurs. Defaults to `'30000'` milliseconds.
|
|
35
|
+
- `NITRO_SHUTDOWN_FORCE` - When set to true, it triggers `process.exit()` at the end of the shutdown process. If it's set to `'false'`, the process will simply let the event loop clear. Defaults to `'true'`.
|
|
36
|
+
|
|
37
|
+
## Cluster mode
|
|
38
|
+
**Preset:** `node_cluster`
|
|
39
|
+
|
|
40
|
+
For more performance and leveraging multi-core handling, you can use cluster preset.
|
|
41
|
+
|
|
42
|
+
### Environment Variables
|
|
43
|
+
|
|
44
|
+
In addition to environment variables from the `node_server` preset, you can customize behavior:
|
|
45
|
+
|
|
46
|
+
- `NITRO_CLUSTER_WORKERS`: Number of cluster workers (default is Number of available cpu cores)
|
|
47
|
+
|
|
48
|
+
## Handler (advanced)
|
|
49
|
+
**Preset:** `node_middleware`
|
|
50
|
+
|
|
51
|
+
Nitro also has a more low-level preset that directly exports a middleware usable for custom servers.
|
|
52
|
+
|
|
53
|
+
When running `nitro build` with the Node middleware preset, the result will be an entry point exporting a middleware handler.
|
|
54
|
+
|
|
55
|
+
**Example:**
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import { createServer } from 'node:http'
|
|
59
|
+
import { listener } from './.output/server'
|
|
60
|
+
|
|
61
|
+
const server = createServer(listener)
|
|
62
|
+
server.listen(8080)
|
|
63
|
+
```
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Assets
|
|
2
|
+
|
|
3
|
+
Nitro supports two types of assets: **public assets** served directly to clients and **server assets** bundled into the server for programmatic access.
|
|
4
|
+
|
|
5
|
+
## Public Assets
|
|
6
|
+
|
|
7
|
+
Nitro handles assets via the `public/` directory.
|
|
8
|
+
|
|
9
|
+
All assets in `public/` directory will be automatically served. This means that you can access them directly from the browser without any special configuration.
|
|
10
|
+
|
|
11
|
+
```md
|
|
12
|
+
public/
|
|
13
|
+
image.png <-- /image.png
|
|
14
|
+
video.mp4 <-- /video.mp4
|
|
15
|
+
robots.txt <-- /robots.txt
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Caching and Headers
|
|
19
|
+
|
|
20
|
+
Public assets are served with automatic `ETag` and `Last-Modified` headers for conditional requests. When the client sends `If-None-Match` or `If-Modified-Since` headers, Nitro returns a `304 Not Modified` response.
|
|
21
|
+
|
|
22
|
+
For assets served from a non-root `baseURL` (such as `/build/`), Nitro prevents fallthrough to application handlers. If a request matches a public asset base but the file is not found, a `404` is returned immediately.
|
|
23
|
+
|
|
24
|
+
### Production Public Assets
|
|
25
|
+
|
|
26
|
+
When building your Nitro app, the `public/` directory will be copied to `.output/public/` and a manifest with metadata will be created and embedded in the server bundle.
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"/image.png": {
|
|
31
|
+
"type": "image/png",
|
|
32
|
+
"etag": "\"4a0c-6utWq0Kbk5OqDmksYCa9XV8irnM\"",
|
|
33
|
+
"mtime": "2023-03-04T21:39:45.086Z",
|
|
34
|
+
"size": 18956
|
|
35
|
+
},
|
|
36
|
+
"/robots.txt": {
|
|
37
|
+
"type": "text/plain; charset=utf-8",
|
|
38
|
+
"etag": "\"8-hMqyDrA8fJ0R904zgEPs3L55Jls\"",
|
|
39
|
+
"mtime": "2023-03-04T21:39:45.086Z",
|
|
40
|
+
"size": 8
|
|
41
|
+
},
|
|
42
|
+
"/video.mp4": {
|
|
43
|
+
"type": "video/mp4",
|
|
44
|
+
"etag": "\"9b943-4UwfQXKUjPCesGPr6J5j7GzNYGU\"",
|
|
45
|
+
"mtime": "2023-03-04T21:39:45.085Z",
|
|
46
|
+
"size": 637251
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This allows Nitro to know the public assets without scanning the directory, giving high performance with caching headers.
|
|
52
|
+
|
|
53
|
+
### Custom Public Asset Directories
|
|
54
|
+
|
|
55
|
+
You can configure additional public asset directories using the `publicAssets` config option. Each entry supports the following properties:
|
|
56
|
+
|
|
57
|
+
- `dir` -- Path to the directory (resolved relative to `rootDir`).
|
|
58
|
+
- `baseURL` -- URL prefix for serving assets (default: `"/"`).
|
|
59
|
+
- `maxAge` -- Cache `max-age` in seconds. When set, a `Cache-Control: public, max-age=<value>, immutable` header is applied via route rules.
|
|
60
|
+
- `fallthrough` -- Whether requests should fall through to application handlers when the asset is not found. Top-level (`baseURL: "/"`) directories default to `true`; non-root directories default to `false`.
|
|
61
|
+
- `ignore` -- Pass `false` to disable ignore patterns, or an array of glob patterns to override the global `ignore` option.
|
|
62
|
+
|
|
63
|
+
```js [nitro.config.ts]
|
|
64
|
+
import { defineNitroConfig } from "nitro/config";
|
|
65
|
+
|
|
66
|
+
export default defineNitroConfig({
|
|
67
|
+
publicAssets: [
|
|
68
|
+
{
|
|
69
|
+
baseURL: "build",
|
|
70
|
+
dir: "public/build",
|
|
71
|
+
maxAge: 3600,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
In this example, files in `public/build/` are served under `/build/` with a one-hour cache and no fallthrough to application handlers.
|
|
77
|
+
|
|
78
|
+
### Compressed Public Assets
|
|
79
|
+
|
|
80
|
+
Nitro can generate pre-compressed versions of your public assets during the build. When a client sends an `Accept-Encoding` header, the server will serve the compressed version if available. Supported encodings are gzip (`.gz`), brotli (`.br`), and zstd (`.zst`).
|
|
81
|
+
|
|
82
|
+
Set `compressPublicAssets: true` to enable all encodings:
|
|
83
|
+
|
|
84
|
+
```js [nitro.config.ts]
|
|
85
|
+
import { defineNitroConfig } from "nitro/config";
|
|
86
|
+
|
|
87
|
+
export default defineNitroConfig({
|
|
88
|
+
compressPublicAssets: true,
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or pick specific encodings:
|
|
93
|
+
|
|
94
|
+
```js [nitro.config.ts]
|
|
95
|
+
import { defineNitroConfig } from "nitro/config";
|
|
96
|
+
|
|
97
|
+
export default defineNitroConfig({
|
|
98
|
+
compressPublicAssets: {
|
|
99
|
+
gzip: true,
|
|
100
|
+
brotli: true,
|
|
101
|
+
zstd: false,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> [!NOTE]
|
|
107
|
+
> Only compressible MIME types (text, JavaScript, JSON, XML, WASM, fonts, SVG, etc.) with a file size of at least 1 KB are compressed. Source map files (`.map`) are excluded.
|
|
108
|
+
|
|
109
|
+
## Server Assets
|
|
110
|
+
|
|
111
|
+
All assets in `assets/` directory will be added to the server bundle. After building your application, you can find them in the `.output/server/chunks/raw/` directory. Be careful with the size of your assets, as they will be bundled with the server bundle.
|
|
112
|
+
|
|
113
|
+
> [!TIP]
|
|
114
|
+
> Unless using `useStorage()`, assets won't be included in the server bundle.
|
|
115
|
+
|
|
116
|
+
They can be addressed by the `assets:server` mount point using the [storage layer](/docs/storage).
|
|
117
|
+
|
|
118
|
+
For example, you could store a json file in `assets/data.json` and retrieve it in your handler:
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
import { defineHandler } from "nitro";
|
|
122
|
+
|
|
123
|
+
export default defineHandler(async () => {
|
|
124
|
+
const data = await useStorage("assets:server").get("data.json");
|
|
125
|
+
|
|
126
|
+
return data;
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Custom Server Assets
|
|
131
|
+
|
|
132
|
+
In order to add assets from a custom directory, you will need to define a path in your nitro config. This allows you to add assets from a directory outside of the `assets/` directory.
|
|
133
|
+
|
|
134
|
+
Each entry in `serverAssets` supports the following properties:
|
|
135
|
+
|
|
136
|
+
- `baseName` -- Name used as the storage mount point (accessed via `assets:<baseName>`).
|
|
137
|
+
- `dir` -- Path to the directory (resolved relative to `rootDir`).
|
|
138
|
+
- `pattern` -- Glob pattern for file inclusion (default: `"**/*"`).
|
|
139
|
+
- `ignore` -- Array of glob patterns to exclude files.
|
|
140
|
+
|
|
141
|
+
```js [nitro.config.ts]
|
|
142
|
+
import { defineNitroConfig } from "nitro/config";
|
|
143
|
+
|
|
144
|
+
export default defineNitroConfig({
|
|
145
|
+
serverAssets: [
|
|
146
|
+
{
|
|
147
|
+
baseName: "templates",
|
|
148
|
+
dir: "./templates",
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
Then you can use the `assets:templates` base to retrieve your assets.
|
|
154
|
+
|
|
155
|
+
```ts [handlers/success.ts]
|
|
156
|
+
import { defineHandler } from "nitro";
|
|
157
|
+
|
|
158
|
+
export default defineHandler(async (event) => {
|
|
159
|
+
const html = await useStorage("assets:templates").get("success.html");
|
|
160
|
+
|
|
161
|
+
return html;
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
> [!TIP]
|
|
166
|
+
> During development, server assets are read directly from the filesystem using the `fs` unstorage driver. In production, they are bundled into the server as lazy imports with pre-computed metadata (MIME type, ETag, modification time).
|