File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -342,8 +342,7 @@ test('PostCSS dir-dependency', async () => {
342
342
}
343
343
} )
344
344
345
- // skip because #8471 is reverted
346
- test . skip ( 'import dependency includes css import' , async ( ) => {
345
+ test ( 'import dependency includes css import' , async ( ) => {
347
346
expect ( await getColor ( '.css-js-dep' ) ) . toBe ( 'green' )
348
347
expect ( await getColor ( '.css-js-dep-module' ) ) . toBe ( 'green' )
349
348
} )
@@ -430,9 +429,9 @@ test('PostCSS source.input.from includes query', async () => {
430
429
)
431
430
} )
432
431
433
- // skip because #8471 is reverted
434
- test . skip ( 'aliased css has content' , async ( ) => {
432
+ test ( 'aliased css has content' , async ( ) => {
435
433
expect ( await getColor ( '.aliased' ) ) . toBe ( 'blue' )
436
- expect ( await page . textContent ( '.aliased-content' ) ) . toMatch ( '.aliased' )
434
+ // skipped: currently not supported see #8936
435
+ // expect(await page.textContent('.aliased-content')).toMatch('.aliased')
437
436
expect ( await getColor ( '.aliased-module' ) ) . toBe ( 'blue' )
438
437
} )
Original file line number Diff line number Diff line change @@ -381,7 +381,11 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
381
381
code = `export default ${ JSON . stringify ( content ) } `
382
382
}
383
383
} else {
384
- code = `export default ''`
384
+ // if moduleCode exists return it **even if** it does not have `?used`
385
+ // this will disable tree-shake to work with `import './foo.module.css'` but this usually does not happen
386
+ // this is a limitation of the current approach by `?used` to make tree-shake work
387
+ // See #8936 for more details
388
+ code = modulesCode || `export default ''`
385
389
}
386
390
387
391
return {
You can’t perform that action at this time.
0 commit comments