forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.js
33 lines (27 loc) · 752 Bytes
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import path from 'path'
import postcss from 'postcss'
import tailwind from '../../src'
export * from './strings'
export * from './defaults'
export let map = JSON.stringify({
version: 3,
file: null,
sources: [],
names: [],
mappings: '',
})
export function run(input, config, plugin = tailwind) {
let { currentTestName } = expect.getState()
return postcss(plugin(config)).process(input, {
from: `${path.resolve(__filename)}?test=${currentTestName}`,
})
}
export function runWithSourceMaps(input, config, plugin = tailwind) {
let { currentTestName } = expect.getState()
return postcss(plugin(config)).process(input, {
from: `${path.resolve(__filename)}?test=${currentTestName}`,
map: {
prev: map,
},
})
}