multi-page-svelte Svelte Themes

Multi Page Svelte

Creating multiple Pages in one Svelte project

multi-page-svelte

Create multiple svelte-pages with this template. Relies on default template https://github.com/sveltejs/template

Usage

npx degit Tom-Siegel/multi-page-svelte
  1. Create as many Page-files as you want (see src/main.js or src/second.js)
  2. Go to rollup-pages.config.js and set the inputs
const inputs = [
  "main", //string defaults to input: src/[name].js and output: public/build/[name].js
  {
    input: "src/second.js",
    output: { file: "public/build/second.js", name: "second" },
    css: "public/build/second.css",
  }, //object for setting more specific values for input and output of roolup configuration
];
  1. Set up your html-files by adding the main.js, main.css and global.css
  2. Build the project
npm run build

Testing

npm run dev

Or

npm run start

Open your browser url: localhost:5000

main.js --> http://localhost:5000/index.html

second.js --> http://localhost:5000/second.html

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes