Templarian/MaterialDesign-JS

ESM Exports?

bestickley opened this issue · 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.

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 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 f08bac6

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