I want to export components to multiple files from main.js, something like this:
main.js:
import Block1 from './Block1.svelte';
import Block2 from './Block2.svelte';
export const Block1 = new Block1({ target: document.body}); //to index.html
export const Block2 = new Block2({ target: document.body}); //to index2.html
How to compile multiple .html files to public directory in svelt js?
I found this repository:
https://github.com/Tom-Siegel/multi-page-svelte
Works well and is possible to add multiple pages as 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
];