Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Next Next commit
add a few more logs
  • Loading branch information
RobinMalfait committed Dec 9, 2024
commit 5e885dcfa0e43d4576228ada7d40d919524ead73
10 changes: 9 additions & 1 deletion packages/@tailwindcss-postcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
let ast = postCssAstToCssAst(root)
env.DEBUG && I.end('PostCSS AST -> Tailwind CSS AST')

env.DEBUG && I.start('Create compiler')
let compiler = await compileAst(ast, {
base: inputBasePath,
onDependency: (path) => {
context.fullRebuildPaths.push(path)
},
})
env.DEBUG && I.end('Create compiler')

env.DEBUG && I.end('Setup compiler')
return compiler
Expand All @@ -131,6 +133,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
let rebuildStrategy: 'full' | 'incremental' = 'incremental'

// Track file modification times to CSS files
env.DEBUG && I.start('Register full rebuild paths')
{
for (let file of context.fullRebuildPaths) {
result.messages.push({
Expand Down Expand Up @@ -163,6 +166,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
context.mtimes.set(file, changedTime)
}
}
env.DEBUG && I.end('Register full rebuild paths')

if (
rebuildStrategy === 'full' &&
Expand All @@ -174,6 +178,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
}

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

// Look for candidates used to generate the CSS
context.scanner = new Scanner({ sources })
env.DEBUG && I.end('Setup scanner')
}

env.DEBUG && I.start('Scan for candidates')
Expand All @@ -199,6 +205,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
env.DEBUG && I.end('Scan for candidates')

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

env.DEBUG && I.start('Build utilities')
Expand Down Expand Up @@ -283,8 +291,8 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
// Trick PostCSS into thinking the indent is 2 spaces, so it uses that
// as the default instead of 4.
root.raws.indent = ' '

env.DEBUG && I.end('Update PostCSS AST')

env.DEBUG && I.end(`[@tailwindcss/postcss] ${relative(base, inputFile)}`)
env.DEBUG && I.report()
},
Expand Down