Closed ListenV closed 1 year ago
Yes, this is OK. I have never seen any filename conflicts nor has anyone reported them.
When building only HTML files, like what you're doing here, the plugin does a standard build as described by Vite's multi-page app documentation. So the output you're seeing is what Vite normally outputs for multiple HTML files, with code splitting enabled.
You can also control the output folder structure a little bit by changing your source code's folder structure.
OK, I have solved this problem.
my vite.config.ts
:
build: {
rollupOptions: {
output: {
chunkFileNames: 'assets/[name].js',
entryFileNames: ({ name }) => {
if (name === 'service_worker')
return '[name].js'
else
return 'assets/[name].js'
},
assetFileNames: 'assets/[name][extname]',
},
},
},
and output:
.
├── home.html
├── manifest.json
├── popup.html
├── redirect.html
├── service_worker.js
└── assets
├── home.css
├── home.js
├── ListItem.js
├── popup.js
└── icon
├── favicon.ico
├── icon-128.png
├── icon-16.png
├── icon-32.png
├── icon-48.png
└── icon.png
Summary
All file outputs in the same directery, like this:
Reproduction
My
vite.config.ts
:Environment