Fix CLI --content option (#5775)
* Add failing test * Fix CLI `--content` option
This commit is contained in:
parent
1a08732382
commit
92df04d0c3
2 changed files with 15 additions and 1 deletions
|
|
@ -145,6 +145,20 @@ describe('Build command', () => {
|
|||
)
|
||||
})
|
||||
|
||||
test('--content', async () => {
|
||||
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
|
||||
|
||||
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`<div class="font-bold"></div>`)
|
||||
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ async function build() {
|
|||
}
|
||||
|
||||
if (args['--content']) {
|
||||
resolvedConfig.content = args['--content'].split(/(?<!{[^}]+),/)
|
||||
resolvedConfig.content.files = args['--content'].split(/(?<!{[^}]+),/)
|
||||
}
|
||||
|
||||
return resolvedConfig
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue