Skip to content

Commit cf9ace1

Browse files
authored
fix(css): stylus Evaluator support (#21376)
1 parent 10b2495 commit cf9ace1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • packages/vite/src/node/plugins

packages/vite/src/node/plugins/css.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,10 +2962,14 @@ const makeStylWorker = (maxWorkers: number | undefined) => {
29622962
{
29632963
shouldUseFake(_stylusPath, _content, _root, options) {
29642964
// define can include functions and those are not serializable
2965-
// in that case, fallback to running in main thread
2965+
// Evaluator is always a function
2966+
// in those cases, fallback to running in main thread
29662967
return !!(
2967-
options.define &&
2968-
Object.values(options.define).some((d) => typeof d === 'function')
2968+
(options.define &&
2969+
Object.values(options.define).some(
2970+
(d) => typeof d === 'function',
2971+
)) ||
2972+
options.Evaluator
29692973
)
29702974
},
29712975
max: maxWorkers,

0 commit comments

Comments
 (0)