While building I wish to change the output destination to an input file when using rollup+vite.
An Example MVE:
Input
src/
| foo/
| | foo.html
| bar
| | bar.css
Desired Output
dist/
| foo.html
| assets/
| | name.css
Current Output
dist/
| src/
| | foo/
| | | foo.html
| assets/
| | name.css
vite.config.js
export default defineConfig({
plugins: [svelte(), splitVendorChunkPlugin()],
build: {
rollupOptions: {
input: {
app_timesheet: "./src/foo/foo.html"
},
output: {
/* .. ?? .. */
}
},
}
})
So far I have tried augmenting the output.assetFileNames
but when returning the name, the function does not change the path.
I have also tried using the Roll-Up Plugin API, but I can t seem to find a build or output hook that is relevant.
Any Help or Advice would be apricated.