npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rollup-config-sven

v0.2.6

Published

`sven` is a minimal static site generator for [svelte](https://svelte.dev/). It aims to implement the following use-case:

Readme

Banner

sven

sven is a minimal static site generator for svelte. It aims to implement the following use-case:

  • Generate static files from svelte components (treated as routes)
  • Split common css/js files into the bundle
  • Allow for asset caching

If you have a more advanced use-case you may want to evaluate one of the following:

Quickstart

Created a new index.svelte file in a pages directory:

<main>Home</home>

sven requires both svelte and rollup as peer dependencies.

$ yarn add svelte rollup rollup-config-sven -D

After you've installed the dependencies, you can run the build with:

$ npx rollup -c node:sven

You should now have a public directory containing your static files!

Check out the example for a more advanced example.

Overview

sven is built on rollup, and uses the following strategy:

Routing

sven uses the filesystem to define routing. All svelte components found in the are treated as individual routes.

Each svelte component is treated as an individual app. An entrypoint is dynamically generated as a virtual module at compile-time and used as the rollup input.

This is processed by a variety of rollup plugins that perform the following steps for each detected route:

  • Compile Svelte Component
  • Generate files for the css and js chunks from the component
  • Generate an HTML file with links to these chunks.

This leaves you with a deployable static site in the .

Asset Bundling Strategy

Any CSS or Javascript that is parsed from the svelte component is emitted as a chunk into <assetDir>/<pagesDir> under the path of the route.

Example:

admin/dashboard.svelte -> <assetDir>/<pagesDir>/admin/dashboard.[hash].css
admin/dashboard.svelte -> <assetDir>/<pagesDir>/admin/dashboard.[hash].js

Svelte itself is also treated as an external module so that it can be cached across routes. It is generated into <assetDir>/<pagesDir>/svelte.[hash].js and linked in all resulting HTML files.

Configuration

You can modify the sven configuration with a sven.config.js.

You can view the default config here.

module.exports = {
  /**
   * Set the output directory
   */ 
  outDir: 'public',

  /**
   * Set the asset directory.
   * All css and js files are put here
   */ 
  assetDir: 'assets',

  /**
   * Set the pages directory.
   * All .svelte files in this directory are used as individual
   * routes
   */ 
  pagesDir: 'pages',

  /**
   * Set the static assets directory.
   * Files in this directory are copied to the <outDir>
   */
  staticDir: 'static',

  /**
   * Enables clean urls.
   * Nested routes will use their name as a directory name and
   * will have an index.html created inside.
   * 
   * Example:
   * 
   * about.svelte -> about/index.html
   */ 
  cleanUrls: true,

  /**
   * Sets a list of paths to be bundled under a common.[hash].css file
   */
  commonStyles: ['styles/common.css'],
  
  /**
   * Enables production optimizations
   */ 
  production: process.env.NODE_ENV === "production" || !process.env.ROLLUP_WATCH,

  /**
   * Enables source map generation
   */ 
  sourceMaps: !production,

  /**
   * This object is passed directly into the rollup-plugin-svelte function
   */ 
  svelteConfig: {
    emitCss: true
  }
}

Development

Install dependencies:

$ yarn

Run in development mode:

$ yarn dev

Build:

$ yarn build