Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
userquin opened this issue Nov 27, 2023 · 10 comments · May be fixed by #29
Open

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

userquin opened this issue Nov 27, 2023 · 10 comments · May be fixed by #29
Labels
question Further information is requested

Comments

@userquin
Copy link

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

@Templarian
Copy link
Owner

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

@Templarian Templarian closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
@Templarian Templarian added the question Further information is requested label Nov 27, 2023
@userquin
Copy link
Author

userquin commented Nov 27, 2023

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

imagen

Check also https://publint.dev/@mdi/[email protected]

You should add package exports.

@Templarian Templarian reopened this Nov 27, 2023
@Templarian Templarian changed the title Provide ESM build Add "exports" in package.json ESM build Nov 27, 2023
@Templarian
Copy link
Owner

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

@userquin
Copy link
Author

userquin commented Nov 27, 2023

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

@userquin
Copy link
Author

Thay's why I create mdi-js-es package unplugin/unplugin-auto-import#451

@susnux
Copy link

susnux commented Feb 6, 2024

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.

@susnux susnux linked a pull request Feb 9, 2024 that will close this issue
@leogargioni
Copy link

@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
Copy link
Owner

Templarian commented Mar 30, 2024

Right now we're thinking of adding...

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

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

@susnux
Copy link

susnux commented Mar 30, 2024

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants