Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thespyder/named-imports-rollup
Demonstrating named imports and tree shaking
https://github.com/thespyder/named-imports-rollup
Last synced: about 1 month 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 (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T04:39:58.000Z (over 3 years ago)
- Last Synced: 2024-04-17T07:02:27.275Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- 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 🤷♂️