File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
packages/weapp-tailwindcss/src Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " weapp-tailwindcss " : patch
3+ ---
4+
5+ 修复 tailwindcss v4 在自动收集 cssEntries 时丢失基准目录的问题:从上下文创建 patcher 时附带工作区 base,保留用户显式设置的 v4 base,并在多 patcher 聚合时沿用首个 patcher 的配置。
Original file line number Diff line number Diff line change @@ -277,8 +277,19 @@ export function createTailwindcssPatcherFromContext(ctx: InternalUserDefinedOpti
277277 ctx . cssEntries = normalizedCssEntries
278278 }
279279
280+ const shouldAttachBase = Boolean ( ctx . tailwindcssBasedir && normalizedCssEntries ?. length )
281+ const tailwindcssWithBase = shouldAttachBase && tailwindcss ?. v4 !== null
282+ ? {
283+ ...( tailwindcss ?? { } ) ,
284+ v4 : {
285+ ...( tailwindcss ?. v4 ?? { } ) ,
286+ base : tailwindcss ?. v4 ?. base ?? resolvedTailwindcssBasedir ,
287+ } ,
288+ }
289+ : tailwindcss
290+
280291 const patcherOptions : TailwindcssPatcherFactoryOptions = {
281- tailwindcss,
292+ tailwindcss : tailwindcssWithBase ,
282293 tailwindcssPatcherOptions,
283294 supportCustomLengthUnitsPatch,
284295 appType,
Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ export function createMultiTailwindcssPatcher(patchers: TailwindcssPatcherLike[]
316316
317317 const [ first ] = patchers
318318 const multiPatcher : TailwindcssPatcherLike = {
319+ ...first ,
319320 packageInfo : first ?. packageInfo ,
320321 majorVersion : first ?. majorVersion ,
321322 options : first ?. options ,
You can’t perform that action at this time.
0 commit comments