bestickley
Feature Request: ESM Exports. I use Vite for front-end tooling and without ESM exports the whole library is sent to the browser.
#24 · closed · 3 comments
Feature Request: ESM Exports. I use Vite for front-end tooling and without ESM exports the whole library is sent to the browser.
Another alternative is to split every icon into a separate JS file so even using CommonJS they can be imported separately.
The package already provides an [ESM](https://github.com/Templarian/MaterialDesign-JS/blob/master/package.json#L6). Not familiar with Vite, but all modern JS frameworks have tree shaking, so you might need to configure it. Please open an issue on the [main repo](https://github.com/Templarian/MaterialDesign) if this is actually an issue.
@bestickley I forked and build as separated file to support es module. try to use this version to check if it solve your problem. `npm i blackbing/MaterialDesign-JS#feature/es` the main change is here <https://github.com/Templarian/MaterialDesign-JS/commit/f08bac66f60e0238b60c90ed95a677b5611bdaf5> I just write these strings to separated file.it will allow some old bundler treat es module as well. If it solved your problem, I will open an issue to [main repo](https://github.com/Templarian/MaterialDesign)