Allow piping data into the CLI (#6876)
* use outputFile instead of direct writeFile This is an improvement we introduced earlier but forgot this part. * allow to pipe in data to the CLI * add integration tests to validate piping to the CLI * update changelog
This commit is contained in:
parent
058a9256ae
commit
657bf5f8c9
4 changed files with 74 additions and 13 deletions
|
|
@ -27,6 +27,23 @@ describe('static build', () => {
|
|||
)
|
||||
})
|
||||
|
||||
it('should be possible to pipe in data', async () => {
|
||||
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
|
||||
|
||||
await $('cat ./src/index.css | node ../../lib/cli.js -i - -o ./dist/main.css', {
|
||||
shell: true,
|
||||
env: { NODE_ENV: 'production' },
|
||||
})
|
||||
|
||||
expect(await readOutputFile('main.css')).toIncludeCss(
|
||||
css`
|
||||
.font-bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
`
|
||||
)
|
||||
})
|
||||
|
||||
it('should safelist a list of classes to always include', async () => {
|
||||
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
|
||||
await writeInputFile(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue