diff --git a/README.md b/README.md index e2734a9..8fb9f8a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,38 @@ 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. + +**or** + +2. Don't transpile ESM imports to CJS (which I think prevents tree shaking? Although I could be wrong). diff --git a/package.json b/package.json index 155df0d..2450bc3 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,5 @@ "react": "^16.3.2", "react-dom": "^16.3.2" }, - "sideEffects": [ - "*.css", - "*.scss" - ] + "sideEffects": true }