diff --git a/.babelrc b/.babelrc index b15bc92..622e679 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { "presets": [ - ["es2015", { "modules": false }], + "es2015", "react"], } diff --git a/README.md b/README.md index e2734a9..8a7fab4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,39 @@ yarn && yarn dev && yarn prod ``` -2. Exampine the two css files in dist/. +2. Examine the two css files in dist/. 3. Note the difference in CSS order. +```css + +/* Dev Build*/ + +.ComponentC_main { + color: black; +} + +.ComponentB_main { + color: lightblue; +} + +/* Prod Build */ + +.ComponentB_main { + color: lightblue; +} + +.ComponentC_main { + color: black; +} + +``` + +I can mitigate this by: + +1. Setting `sideEffects: true` in package.json. I'd prefer to not do this. + - `git checkout with-sideeffects` and run the above steps + +**or** + +2. Don't transpile ESM imports to CJS (which I think prevents tree shaking? Although I could be wrong).