Fix invalid arg type (#3978)

* default to `tailwind.css` file when no input is given

* skip undefined files

* update forgotten test fixtures
This commit is contained in:
Robin Malfait 2021-04-06 00:12:52 +02:00 committed by GitHub
parent 8bce53b9ca
commit 6ed835cb71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

View File

@ -1,4 +1,4 @@
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

View File

@ -1,4 +1,4 @@
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

View File

@ -1,4 +1,4 @@
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

View File

@ -227,6 +227,8 @@ function trackModified(files) {
let changed = false
for (let file of files) {
if (!file) continue
let pathname = url.parse(file).pathname
let newModified = fs.statSync(decodeURIComponent(pathname)).mtimeMs

View File

@ -1,3 +1,4 @@
import path from 'path'
import postcss from 'postcss'
import * as utils from './utils'
@ -29,15 +30,15 @@ export default function compile(options = {}) {
const css = config.inputFile
? utils.readFile(config.inputFile)
: `
@tailwind base;
@tailwind components;
@tailwind utilities;
`
@tailwind base;
@tailwind components;
@tailwind utilities;
`
return new Promise((resolve, reject) => {
postcss(config.plugins)
.process(css, {
from: config.inputFile,
from: config.inputFile || path.resolve(__dirname, '../../tailwind.css'),
to: config.outputFile,
})
.then(resolve)