Templarian / MaterialDesign-JS

Dist for Material Design Icons JS/TypeScript
Other
156 stars 18 forks source link

Add "exports" in package.json ESM build #28

Open userquin opened 7 months ago

userquin commented 7 months ago

Feel free to use https://github.com/userquin/mdi-js-es here, if so, I'll deprecate my package/repo.

Templarian commented 7 months ago

@userquin We provide ES6 and commonjs in the package. If you're having issues with a specific framework/build toolchain let us know.

userquin commented 7 months ago

Checking types here https://arethetypeswrong.github.io/?p=%40mdi%2Fjs%407.3.67

imagen

Check also https://publint.dev/@mdi/js@7.3.67

You should add package exports.

Templarian commented 7 months ago

@userquin Good call we'll add "exports" in the next release. Updated the title of the bug to reflect this.

userquin commented 7 months ago

Just build the package, generate the tgz and upload it to first url, should be ESM in node 16 ESM.

userquin commented 7 months ago

Thay's why I create mdi-js-es package https://github.com/unplugin/unplugin-auto-import/pull/451

susnux commented 5 months ago

This is really needed, currently if we bundle using webpack all icons are included meaning if you just use 2 icon you still get a 3MB sized bundle of icons.

leogargioni commented 3 months ago

@userquin Good call we'll add "exports" in the next release. Updated the title of the bug to reflect this.

Any idea of when the new version will be released?

Templarian commented 3 months ago

Right now we're thinking of adding...

{
    ".": "./mdi.js",
    "./*": "./glyph/*/*.js",
}

This would allow '@mdi/js/account' -> glphy/account/account.js.

susnux commented 3 months ago

See the PR I created, you also need to export the Typescript interface or it could not be used with moduleresolution node16 or later

blandfried commented 2 months ago

Any updates on when this will be merged in? Looking to use this and move away from MUI framework but holding us back cause of ESM support.