https://github.com/thespyder/named-imports-rollup
Demonstrating named imports and tree shaking
https://github.com/thespyder/named-imports-rollup
Last synced: 2 months ago
JSON representation
Demonstrating named imports and tree shaking
- Host: GitHub
- URL: https://github.com/thespyder/named-imports-rollup
- Owner: TheSpyder
- Created: 2019-02-11T21:05:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T04:39:58.000Z (almost 4 years ago)
- Last Synced: 2025-03-16T23:22:38.134Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Named imports and tree shaking
==============================Demonstrating that `import * as name from ...` style named imports are tree shaken by Rollup.
Info
----
`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.Usage
-----* `yarn`
* `yarn run` to show the code works
* `yarn build && cat scratch/index.js` to see `ronge` is tree shaken outuncomment the last line of `index.mjs` and rebuild to see `ronge` _is_ imported.
Credits
-------`Arr.range` implementation borrowed from [katamari](https://github.com/ephox/katamari/blob/master/src/main/ts/ephox/katamari/api/Arr.ts#L39) which is Apache licensed
License
-------
Do whatever you want 🤷♂️