Demonstrating that import * as name from ...
style named imports are tree shaken by Rollup.
index.mjs
is the entry point, which imports arr.mjs
. It can be executed by nodejs to demonstrate that it works. With rollup, only the range
method of arr.mjs
is included in the output.
yarn
yarn run
to show the code worksyarn build && cat scratch/index.js
to seeronge
is tree shaken out
uncomment the last line of index.mjs
and rebuild to see ronge
is imported.
Arr.range
implementation borrowed from katamari which is Apache licensed
Do whatever you want 🤷♂️