File tree 5 files changed +16
-18
lines changed
5 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -649,7 +649,19 @@ export async function buildEnvironment(
649
649
// TODO: remove this and enable rolldown's CSS support later
650
650
moduleTypes : {
651
651
...options . rollupOptions . moduleTypes ,
652
- '.css' : 'js' ,
652
+ // https://github.com/rolldown/rolldown/blob/4020de442a8ab0f7973794ead3b8aa04e316d558/crates/rolldown/src/module_loader/module_task.rs#L120
653
+ // @ts -expect-error css
654
+ '.sass' : 'css' ,
655
+ // @ts -expect-error css
656
+ '.scss' : 'css' ,
657
+ // @ts -expect-error css
658
+ '.sss' : 'css' ,
659
+ // @ts -expect-error css
660
+ '.styl' : 'css' ,
661
+ // @ts -expect-error css
662
+ '.stylus' : 'css' ,
663
+ // @ts -expect-error css
664
+ '.less' : 'css' ,
653
665
} ,
654
666
}
655
667
Original file line number Diff line number Diff line change @@ -781,11 +781,6 @@ async function prepareRolldownOptimizerRun(
781
781
conditionNames : [ 'browser' ] ,
782
782
} ,
783
783
...rollupOptions ,
784
- // TODO: remove this and enable rolldown's CSS support later
785
- moduleTypes : {
786
- '.css' : 'js' ,
787
- ...rollupOptions . moduleTypes ,
788
- } ,
789
784
} )
790
785
if ( canceled ) {
791
786
await bundle . close ( )
@@ -1067,11 +1062,6 @@ export async function extractExportsData(
1067
1062
...remainingRollupOptions ,
1068
1063
plugins,
1069
1064
input : [ filePath ] ,
1070
- // TODO: remove this and enable rolldown's CSS support later
1071
- moduleTypes : {
1072
- '.css' : 'js' ,
1073
- ...remainingRollupOptions . moduleTypes ,
1074
- } ,
1075
1065
} )
1076
1066
const result = await build . generate ( {
1077
1067
...rollupOptions . output ,
Original file line number Diff line number Diff line change @@ -577,7 +577,7 @@ export function cssPostPlugin(config: ResolvedConfig): RolldownPlugin {
577
577
code = `export default ${ JSON . stringify ( content ) } `
578
578
} else {
579
579
// empty module when it's not a CSS module nor `?inline`
580
- code = ''
580
+ code = css
581
581
}
582
582
583
583
return {
Original file line number Diff line number Diff line change @@ -221,7 +221,8 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): [Plugin] {
221
221
}
222
222
} ,
223
223
224
- async transform ( source , importer ) {
224
+ async transform ( source , importer , opts ) {
225
+ if ( opts ?. moduleType === 'css' ) return
225
226
if ( isInNodeModules ( importer ) && ! dynamicImportPrefixRE . test ( source ) ) {
226
227
return
227
228
}
Original file line number Diff line number Diff line change @@ -85,11 +85,6 @@ async function bundleWorkerEntry(
85
85
onwarn ( warning , warn ) {
86
86
onRollupWarning ( warning , warn , workerEnvironment )
87
87
} ,
88
- // TODO: remove this and enable rolldown's CSS support later
89
- moduleTypes : {
90
- '.css' : 'js' ,
91
- ...rollupOptions . moduleTypes ,
92
- } ,
93
88
// preserveEntrySignatures: false,
94
89
} )
95
90
let chunk : OutputChunk
You can’t perform that action at this time.
0 commit comments