Control multi-page html input/output with Vite

19 Views Asked by At

I'm trying to figure out how to setup a vite config to achieve the following input/output structure:

/views/home/home.template.html
/views/about/about.template.html

I have my html files like above with their specific JS / CSS imports.

{out_dir}/home/home.html
{out_dir}/home/js/*.bundle.js
{out_dir}/home/css/*.bundle.css
{out_dir}/about/about.html

And above is how I'd like the output to look. Essentially I want to transform (for ex. home page) from views/home/home.template.html -> {out_dir}/home/home.html and have their JS/CSS imports bundled under "js" / "css" sub directories.

Is there a config option or any plugins I can use to achieve this?

0

There are 0 best solutions below