Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Put compiler into a var
  • Loading branch information
philipp-spiess committed Apr 3, 2025
commit 10b0c766ea657fafe191a35ed5dfc2b092356440
10 changes: 5 additions & 5 deletions packages/@tailwindcss-postcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,10 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
context.compiler = createCompiler()
}

let compiler = await context.compiler

if (context.scanner === null || rebuildStrategy === 'full') {
DEBUG && I.start('Setup scanner')
let compiler = await context.compiler
let sources = (() => {
// Disable auto source detection
if (compiler.root === 'none') {
Expand All @@ -216,11 +217,10 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
}

DEBUG && I.start('Scan for candidates')
let candidates =
(await context.compiler).features & Features.Utilities ? context.scanner.scan() : []
let candidates = compiler.features & Features.Utilities ? context.scanner.scan() : []
DEBUG && I.end('Scan for candidates')

if ((await context.compiler).features & Features.Utilities) {
if (compiler.features & Features.Utilities) {
DEBUG && I.start('Register dependency messages')
// Add all found files as direct dependencies
for (let file of context.scanner.files) {
Expand Down Expand Up @@ -269,7 +269,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
}

DEBUG && I.start('Build utilities')
let tailwindCssAst = (await context.compiler).build(candidates)
let tailwindCssAst = compiler.build(candidates)
DEBUG && I.end('Build utilities')

if (context.tailwindCssAst !== tailwindCssAst) {
Expand Down