I’m having a hard time trying to use vite. I have 2 html files and I would like to generate them with the imports automatically. However I’ve been able to do only one. I’m trying to import tachyons.css for all the pages right? That I could do it. but I also wanna create specific scripts for each page I don’t know how to config to set automatically. Not even compile it.
import { defineConfig, Plugin } from "vite";
import { createHtmlPlugin } from "vite-plugin-html";
export default defineConfig({
root: "src",
plugins: [
createHtmlPlugin({
minify: true,
entry: "js/home.ts",
pages: [
{ filename: "index", template: "index.html" },
{ filename: "about", template: "about.html" },
],
}),
],
build: {
outDir: "../dist",
emptyOutDir: true,
},
});
in home.ts I’m only importing the tachyons e the about.ts is not beeing compiled and insert ed into about.html
this is the structure of my folder