Add sourcemaps for replaced preflight styles

This commit is contained in:
Adam Wathan 2018-03-30 10:23:56 -04:00
parent 64d3cf5e2a
commit 2e34df923e

View file

@ -13,9 +13,13 @@ export default function(config) {
css.walkAtRules('tailwind', atRule => {
if (atRule.params === 'preflight') {
atRule.before(
postcss.parse(fs.readFileSync(`${__dirname}/../../css/preflight.css`, 'utf8'))
const preflightTree = postcss.parse(
fs.readFileSync(`${__dirname}/../../css/preflight.css`, 'utf8')
)
preflightTree.walk(node => (node.source = atRule.source))
atRule.before(preflightTree)
atRule.remove()
}