Skip to content

Commit 6ed835c

Browse files
authored
Fix invalid arg type (#3978)
* default to `tailwind.css` file when no input is given * skip undefined files * update forgotten test fixtures
1 parent 8bce53b commit 6ed835c

6 files changed

+12
-9
lines changed

__tests__/fixtures/tailwind-output-flagged.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
1+
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
22

33
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
44

__tests__/fixtures/tailwind-output-important.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
1+
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
22

33
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
44

__tests__/fixtures/tailwind-output-no-color-opacity.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
1+
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
22

33
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
44

__tests__/fixtures/tailwind-output.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com */
1+
/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */
22

33
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
44

jit/lib/setupContext.js

+2
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ function trackModified(files) {
227227
let changed = false
228228

229229
for (let file of files) {
230+
if (!file) continue
231+
230232
let pathname = url.parse(file).pathname
231233
let newModified = fs.statSync(decodeURIComponent(pathname)).mtimeMs
232234

src/cli/compile.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path'
12
import postcss from 'postcss'
23

34
import * as utils from './utils'
@@ -29,15 +30,15 @@ export default function compile(options = {}) {
2930
const css = config.inputFile
3031
? utils.readFile(config.inputFile)
3132
: `
32-
@tailwind base;
33-
@tailwind components;
34-
@tailwind utilities;
35-
`
33+
@tailwind base;
34+
@tailwind components;
35+
@tailwind utilities;
36+
`
3637

3738
return new Promise((resolve, reject) => {
3839
postcss(config.plugins)
3940
.process(css, {
40-
from: config.inputFile,
41+
from: config.inputFile || path.resolve(__dirname, '../../tailwind.css'),
4142
to: config.outputFile,
4243
})
4344
.then(resolve)

0 commit comments

Comments
 (0)