Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/adapter-static

Package Overview
Dependencies
Maintainers
0
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-static

Adapter for SvelteKit apps that prerenders your entire site as a collection of static files

  • 3.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created

What is @sveltejs/adapter-static?

@sveltejs/adapter-static is an adapter for SvelteKit that allows you to build static sites. It generates a static version of your SvelteKit app, which can be hosted on any static hosting service.

What are @sveltejs/adapter-static's main functionalities?

Static Site Generation

This feature allows you to configure the SvelteKit app to generate a static site. The code sample shows how to set up the adapter in the SvelteKit configuration file to output the static files to a 'build' directory.

import adapter from '@sveltejs/adapter-static';

export default {
  kit: {
    adapter: adapter({
      pages: 'build',
      assets: 'build',
      fallback: null
    })
  }
};

Custom Fallback Page

This feature allows you to specify a custom fallback page for single-page applications. The code sample demonstrates how to set a '200.html' file as the fallback for routes that are not pre-rendered.

import adapter from '@sveltejs/adapter-static';

export default {
  kit: {
    adapter: adapter({
      fallback: '200.html'
    })
  }
};

Other packages similar to @sveltejs/adapter-static

Keywords

FAQs

Package last updated on 21 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc