We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b382f7e commit 889bfc0Copy full SHA for 889bfc0
2 files changed
packages/vite/src/node/plugins/css.ts
@@ -568,7 +568,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
568
let chunkCSS = ''
569
// the chunk is empty if it's a dynamic entry chunk that only contains a CSS import
570
const isJsChunkEmpty = code === '' && !chunk.isEntry
571
- let isPureCssChunk = true
+ let isPureCssChunk = chunk.exports.length === 0
572
const ids = Object.keys(chunk.modules)
573
for (const id of ids) {
574
if (styles.has(id)) {
playground/glob-import/vite.config.ts
@@ -24,5 +24,14 @@ export default defineConfig({
24
},
25
build: {
26
sourcemap: true,
27
+ rollupOptions: {
28
+ output: {
29
+ manualChunks(id) {
30
+ if (id.includes('foo.css')) {
31
+ return 'foo_css'
32
+ }
33
+ },
34
35
36
37
})
0 commit comments