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

[Question] Is it possible to add extensions for the polyfill routes like .js and .mjs #14

Closed
JayaKrishnaNamburu opened this issue Jun 11, 2021 · 2 comments · Fixed by #15

Comments

@JayaKrishnaNamburu
Copy link
Contributor

Thanks for the plugin 😄

I am trying to use this plugins inside a docusaurus project which uses webpack 5.
So, i created a tiny wrapper around docusaurus, so i can inject this inside the webpack config.
https://github.com/JayaKrishnaNamburu/docusaurus-node-polyfills

But the problem is, one of the dependencies is using process but the package is configured as esm module with type: module in it's package.json field. You can find the config field here https://unpkg.com/browse/[email protected]/package.json

And since, the package is using module flag. And in node~14 which supports it. Needs the file extension to import the package and so started to throw error. Something like this

Screenshot 2021-06-11 at 10 10 29 PM

I am not sure, where this should be handled, should webpack do it. Or should the plugins which polyfills the node stuff should take care of the extensions etc 😄. Please close this, if not in the scope of repo.

@Richienb
Copy link
Owner

See #11 (comment)

@JayaKrishnaNamburu
Copy link
Contributor Author

Ah, this is a duplicate. So does adding process/browser.js solves this thing 🤔. I will take a look once it if fixes this

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

Successfully merging a pull request may close this issue.

2 participants