material-components / material-components-web

Modular and customizable Material Design UI components for the web
https://material.io/develop/web
MIT License
17.11k stars 2.15k forks source link

[ALL] NPM packages are missing file extensions in ES6 exports #8174

Open jogibear9988 opened 4 months ago

jogibear9988 commented 4 months ago

Bug report

I want to use the packages in a ES6 environment without a bundler, but only using a importmap. This would work, but all your packages contain imports without file extensions, so this does not work. NPM packages with ES6 export should contain file extensions in the package, or list all the named exports in the exports section.

Possible solution

Add file extensions in generated JS files, or add the .js file already in the typescript code.

For example here: https://github.com/material-components/material-components-web/blob/c43b3438b4b7eeb777072525f9ae07c97d27c0bb/packages/mdc-top-app-bar/index.ts#L24

(or everywhere else)