Add missing "type": "module" to package.json for Vite resolution #32
Labels
🙅 no/wontfix
This is not (enough of) an issue for this project
👎 phase/no
Post cannot or will not be acted on
Initial checklist
Affected packages and versions
latest
Link to runnable example
No response
Steps to reproduce
import { toHtml } from 'hast-util-to-html'
in a JS fileExpected behavior
Some developer tools assume any module is a CommonJS module unless "type":"module" is specified in
package.json
.I don't particularly agree with that approach and I'm not sure why the Vite maintainers decided to be more "dumb" about it in their resolution logic versus what they had before, but it seems to me that providing this meta information doesn't hurt and helps tools understand more clearly what format a module is.
Expected: "type": "module" in package.json
Actual behavior
Missing "type": "module" in package.json, results in tools thinking the module is CommonJS format.
Affected runtime and version
[email protected]
Affected package manager and version
[email protected]
Affected OS and version
No response
Build and bundle tools
Vite
The text was updated successfully, but these errors were encountered: