Wojciech Maj

Results 257 comments of Wojciech Maj

Try adding ```js resolve: { extensions: ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json'] } ``` to Webpack config.

@shesha4kr This is completely unrelated to this thread. Please raise a separate issue.

One improvement that comes to my mind is that .d.ts files sitting in pseudorepo /sidecar and /UI directories could reexport type definitions from /dist/cjs instead.

Don't worry mate. No one has the right to expect anything from you for $0.

@theKashey - The approach I took with dual ESM/CJS config presented here was battle tested in React-PDF, React-Calendar, React-Date-Picker and many other packages I maintain. I do understand your concerns...

I rebased the PR off latest master, and edited the first comment, since now the PR is making _everything_ green, not just ESM module resolution!

> Not sure how "real" this case is Most bundlers will probably use ESM, because they are capable of resolving ESM. Even if the modules are CJS, they are "wrapped"...

It's nothing Remix specific, it's actually wrong. Here's another tool confirming it: https://arethetypeswrong.github.io/?p=react-focus-lock%402.9.5

I don't think that's true. Package could be made ESM compatible without breaking changes. The solution would be to ship separate types for ESM and CJS builds. The issue we're...