Merge pull request #442 from tailwindcss/preflight-sourcemaps

Add sourcemaps for replaced preflight styles
This commit is contained in:
Adam Wathan 2018-03-30 10:29:20 -04:00 • committed by GitHub
commit 14f1ba6cb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()
}