-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Clear and concise description of the problem
Currently the only possible option to input files for build is .js files in blob.
rollupOptions: {
input: FastGlob.sync(['./src/**/*.js']).map(entry => resolve(process.cwd(), entry))
}If I add .css files into the blob, it doesn't have a expected entry in manifest.json. Which doesn't seem to be something that should be hard to fix, css files are processed correctly, only manifest entry is missing.
This is also the main reason why to use other alternatives and use Vite only as dev server and build assets with different tools, such us esbuild and gulp-esbuild etc.
Suggested solution
css files should be included in manifest.json as entry, if added in rollupOptions.input, it's also an issue here - #6477
This should be then included in the manifest
"src/styles/main.css": {
"file": "assets/main.9bc805c4.css",
"src": "src/styles/main.css"
},
"src/assets/logo.png": {
"file": "assets/logo.b2fe66e5.png",
"src": "src/assets/logo.png"
},Alternative
The current only way to get .css file into manifest and load it as stylesheet (sources and also procecced files) is to use this dirty hack
if (typeof window[9999] !== 'undefined') {
(async() => await import('/src/styles/main.css'))()
}Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.