According to other issues (e.g. #709) it seems that buildStatic should do rollup if the modules is es2015/es6, but I can't get this to work with systemjs builder 0.16.12. I have done everything that it seems that should be done, but it just doesn't treeshake my solution. If i try to run rollup without systemjs builder it works.
Attach to this issue is a simple example project that I have problems with.
To reproduce it do the following:
unzip the attachment
run npm install
run tsc
run node_modules/.bin/gulp default
Open the bundle.js and see that ChildModule2 is included in the script even if it isn't referenced anywhere. If I use rollup directly the resulting bundle doesn't include ChildModule2.
I have tried to modify the buildStatic options to specifically haverollup: true with the same result, also tried other settings that differs with #709 without any difference.
It may be something I miss, but the documentation is at best lacking for this feature.
According to other issues (e.g. #709) it seems that buildStatic should do rollup if the modules is es2015/es6, but I can't get this to work with
systemjs builder 0.16.12
. I have done everything that it seems that should be done, but it just doesn't treeshake my solution. If i try to runrollup
without systemjs builder it works.Attach to this issue is a simple example project that I have problems with.
To reproduce it do the following:
npm install
tsc
node_modules/.bin/gulp default
Open the bundle.js and see that ChildModule2 is included in the script even if it isn't referenced anywhere. If I use
rollup
directly the resulting bundle doesn't include ChildModule2.I have tried to modify the
buildStatic
options to specifically haverollup: true
with the same result, also tried other settings that differs with #709 without any difference.It may be something I miss, but the documentation is at best lacking for this feature.
Attachment: TreeShaker.zip