From 92df04d0c39bfefbdb08205d18703c2ee41e5432 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Wed, 13 Oct 2021 19:58:15 +0100 Subject: [PATCH] Fix CLI `--content` option (#5775) * Add failing test * Fix CLI `--content` option --- integrations/tailwindcss-cli/tests/cli.test.js | 14 ++++++++++++++ src/cli.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/integrations/tailwindcss-cli/tests/cli.test.js b/integrations/tailwindcss-cli/tests/cli.test.js index 973758ffa..e95e7c18b 100644 --- a/integrations/tailwindcss-cli/tests/cli.test.js +++ b/integrations/tailwindcss-cli/tests/cli.test.js @@ -145,6 +145,20 @@ describe('Build command', () => { ) }) + test('--content', async () => { + await writeInputFile('index.html', html`
`) + + await $(`${EXECUTABLE} --content ./src/index.html --output ./dist/main.css`) + + expect(await readOutputFile('main.css')).toIncludeCss( + css` + .font-bold { + font-weight: 700; + } + ` + ) + }) + test('--postcss (postcss.config.js)', async () => { await writeInputFile('index.html', html`
`) diff --git a/src/cli.js b/src/cli.js index 1ae6bf54e..9e7e3eabf 100644 --- a/src/cli.js +++ b/src/cli.js @@ -430,7 +430,7 @@ async function build() { } if (args['--content']) { - resolvedConfig.content = args['--content'].split(/(?