From 2e34df923ebf8a2ddc9e407840360a6c4a46a7f0 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 30 Mar 2018 10:23:56 -0400 Subject: [PATCH] Add sourcemaps for replaced preflight styles --- src/lib/substituteTailwindAtRules.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/substituteTailwindAtRules.js b/src/lib/substituteTailwindAtRules.js index 70cdaa10ce79..c03dbbace5db 100644 --- a/src/lib/substituteTailwindAtRules.js +++ b/src/lib/substituteTailwindAtRules.js @@ -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() }