Skip to content

Commit 37a83d4

Browse files
committed
Add giant comment about why we're runnign CSS through PostCSS
1 parent e19d86e commit 37a83d4

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎webpack.config.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,20 @@ module.exports = (env, argv) => ({
159159
// Note that we use significantly fewer plugins on the plain
160160
// CSS parser. If we start to parse plain CSS, we end with all
161161
// kinds of nasty problems (like stylesheets not loading).
162+
//
163+
// You might have noticed that we're also sending regular CSS
164+
// through PostCSS. This looks weird, and in fact is probably
165+
// not what you'd expect, however in order for our CSS build
166+
// to work nicely we have to do this. Because down the line
167+
// our SCSS stylesheets reference plain CSS we have to load
168+
// the plain CSS through PostCSS so it can find it safely. This
169+
// also acts like a babel-for-css by transpiling our (S)CSS
170+
// down/up to the right browser support (prefixes, etc).
171+
// Further, if we don't do this then PostCSS assumes that our
172+
// plain CSS is SCSS and it really doesn't like that, even
173+
// though plain CSS should be compatible. The chunking options
174+
// at the top of this webpack config help group the SCSS and
175+
// plain CSS together for the bundler.
162176

163177
require("postcss-simple-vars")(),
164178
require("postcss-strip-inline-comments")(),

0 commit comments

Comments
 (0)