Skip to content

Commit

Permalink
Fix invalid arg type (#3978)
Browse files Browse the repository at this point in the history
* default to `tailwind.css` file when no input is given

* skip undefined files

* update forgotten test fixtures
  • Loading branch information
RobinMalfait authored and adamwathan committed May 7, 2021
1 parent ca9e40e commit 9546d33
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion __tests__/fixtures/tailwind-output-flagged.css
@@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/tailwind-output-important.css
@@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/tailwind-output-no-color-opacity.css
@@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/tailwind-output.css
@@ -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 */

Expand Down
2 changes: 2 additions & 0 deletions jit/lib/setupContext.js
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions src/cli/compile.js
@@ -1,3 +1,4 @@
import path from 'path'
import postcss from 'postcss'

import * as utils from './utils'
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9546d33

Please sign in to comment.