stealjs / steal-tools

Build easy. Load fast.
https://stealjs.com/docs/steal-tools.html
MIT License
67 stars 23 forks source link

import "side-effect" gets tree-shaken if the module is not ES #1050

Closed pYr0x closed 6 years ago

pYr0x commented 6 years ago

here is a demo app. https://github.com/pYr0x/css-treeshaken

using steal and steal-tools -> 2

the options treeShaking: false addes the css files as dependencies to the "main" module

matthewp commented 6 years ago

Looks like it's building out, just removed as a dependency. Looking into it.

matthewp commented 6 years ago

Breaking test: https://github.com/stealjs/steal-tools/commit/1c8c19253908660e6e809ce1cd40ecf02e68b6ff

The problem is not related to CSS, just doesn't work if the dependency is not an ES module.