Skip to content

Commit 92df04d

Browse files
authored
Fix CLI --content option (#5775)
* Add failing test * Fix CLI `--content` option
1 parent 1a08732 commit 92df04d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

integrations/tailwindcss-cli/tests/cli.test.js

+14
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,20 @@ describe('Build command', () => {
145145
)
146146
})
147147

148+
test('--content', async () => {
149+
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
150+
151+
await $(`${EXECUTABLE} --content ./src/index.html --output ./dist/main.css`)
152+
153+
expect(await readOutputFile('main.css')).toIncludeCss(
154+
css`
155+
.font-bold {
156+
font-weight: 700;
157+
}
158+
`
159+
)
160+
})
161+
148162
test('--postcss (postcss.config.js)', async () => {
149163
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
150164

src/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ async function build() {
430430
}
431431

432432
if (args['--content']) {
433-
resolvedConfig.content = args['--content'].split(/(?<!{[^}]+),/)
433+
resolvedConfig.content.files = args['--content'].split(/(?<!{[^}]+),/)
434434
}
435435

436436
return resolvedConfig

0 commit comments

Comments
 (0)