mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
* resolve purge paths * add test for purgecss pattern resolution * resolve purgecss patterns relative to the config file if there is one * account for raw content when transforming purgecss options * append test name to postcss `from` option in purge tests fixes tests hanging * add test for relative purge path resolution in JIT mode
26 lines
678 B
JavaScript
26 lines
678 B
JavaScript
import postcss from 'postcss'
|
|
import fs from 'fs'
|
|
import path from 'path'
|
|
import tailwind from '../../src/jit/index.js'
|
|
|
|
function run(input, config = {}) {
|
|
return postcss(tailwind(config)).process(input, {
|
|
from: path.resolve(__filename),
|
|
})
|
|
}
|
|
|
|
test('relative purge paths', () => {
|
|
let css = `
|
|
@tailwind base;
|
|
@tailwind components;
|
|
@tailwind utilities;
|
|
`
|
|
|
|
return run(css, path.resolve(__dirname, './relative-purge-paths.config.js')).then((result) => {
|
|
let expectedPath = path.resolve(__dirname, './relative-purge-paths.test.css')
|
|
let expected = fs.readFileSync(expectedPath, 'utf8')
|
|
|
|
expect(result.css).toMatchFormattedCss(expected)
|
|
})
|
|
})
|