Svelte Rollup Template screenshot

Svelte Rollup Template

Author Avatar Theme by Metonym
Updated: 30 Aug 2024
27 Stars

Svelte Rollup template with file name hashing and HTML minification

Categories

Overview

The svelte-rollup-template is an enhanced version of the official Svelte Rollup template. It adds the ability to hash the CSS and JS file names during production builds. This template addresses a GitHub issue related to file name hashing. The project utilizes PostHTML to process compiled assets after the build stage.

Features

  • File name hashing: Hashes the file names of CSS and JS bundles during production builds.
  • PostHTML integration: Utilizes PostHTML to process compiled assets after the build stage.
  • Enhanced Svelte Rollup template: Extends the functionality of the official Svelte Rollup template.

Installation

To use the svelte-rollup-template, follow these steps:

  1. Scaffold a new project using degit.
npx degit sveltejs/template svelte-app
cd svelte-app
  1. Install the necessary dependencies.
npm install
  1. Start the app in development mode.
npm run dev
  1. Visit http://localhost:3000 to view the app.

  2. Customize the port number in the rollup.config.js file if needed.

  3. Build the app for production.

npm run build

Summary

The svelte-rollup-template enhances the official Svelte Rollup template by adding file name hashing for CSS and JS bundles during production builds. It also utilizes PostHTML for processing compiled assets after the build stage. This template provides a solution for the GitHub issue related to file name hashing.