Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main, 3.3, 3.4]
branches: [main, v3]

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main, 3.3, 3.4]
branches: [main, v3]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Integration Tests

on:
push:
branches: [main, 3.3, 3.4]
branches: [main, v3]
pull_request:
branches: [main, 3.3, 3.4]
branches: [main, v3]

permissions:
contents: read
Expand Down
50 changes: 25 additions & 25 deletions integrations/parcel/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
Expand All @@ -142,19 +142,19 @@ describe('watcher', () => {

let runningProcess = $('parcel watch ./src/index.html --no-cache')

await waitForOutputFileCreation(/index\.\w+\.css$/)
await waitForOutputFileCreation(/parcel\.\w+\.css$/)

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await appendToInputFile('index.html', html`<div class="font-normal"></div>`)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
Expand All @@ -163,11 +163,11 @@ describe('watcher', () => {
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await appendToInputFile('index.html', html`<div class="bg-red-500"></div>`)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
Expand All @@ -190,19 +190,19 @@ describe('watcher', () => {

let runningProcess = $('parcel watch ./src/index.html --no-cache')

await waitForOutputFileCreation(/index\.\w+\.css$/)
await waitForOutputFileCreation(/parcel\.\w+\.css$/)

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await appendToInputFile('glob/index.html', html`<div class="font-normal"></div>`)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
Expand All @@ -211,11 +211,11 @@ describe('watcher', () => {
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await appendToInputFile('glob/index.html', html`<div class="bg-red-500"></div>`)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
Expand All @@ -242,9 +242,9 @@ describe('watcher', () => {

let runningProcess = $('parcel watch ./src/index.html --no-cache')

await waitForOutputFileCreation(/index\.\w+\.css$/)
await waitForOutputFileCreation(/parcel\.\w+\.css$/)

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
Expand All @@ -255,7 +255,7 @@ describe('watcher', () => {
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await writeInputFile(
'../tailwind.config.js',
javascript`
Expand All @@ -280,7 +280,7 @@ describe('watcher', () => {
)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: bold;
}
Expand All @@ -305,15 +305,15 @@ describe('watcher', () => {

let runningProcess = $('parcel watch ./src/index.html --no-cache')

await waitForOutputFileCreation(/index\.\w+\.css$/)
await waitForOutputFileCreation(/parcel\.\w+\.css$/)

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.font-bold {
font-weight: 700;
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await writeInputFile(
'index.css',
css`
Expand All @@ -330,7 +330,7 @@ describe('watcher', () => {
)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
/* prettier-ignore */
.btn {
border-radius: .25rem;
Expand All @@ -341,7 +341,7 @@ describe('watcher', () => {
}
`)

await waitForOutputFileChange(/index\.\w+\.css$/, async () => {
await waitForOutputFileChange(/parcel\.\w+\.css$/, async () => {
await writeInputFile(
'index.css',
css`
Expand All @@ -358,7 +358,7 @@ describe('watcher', () => {
)
})

expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
expect(await readOutputFile(/parcel\.\w+\.css$/)).toIncludeCss(css`
.btn {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
Expand Down
3 changes: 3 additions & 0 deletions src/lib/setupTrackingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ function getTailwindConfig(configOrPath) {

// It has changed (based on timestamps), or first run
for (let file of newDeps) {
// When loaded transitively through a TypeScript file `require.cache`
// may be undefined. Happens in Node 22.18+.
if (!require.cache) continue
delete require.cache[file]
}
let newConfig = validateConfig(resolveConfig(loadConfig(userConfigPath)))
Expand Down