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 Adam Wathan
parent ca9e40ef67
commit 9546d337e6
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)