Richienb/node-polyfill-webpack-plugin

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

Closed this issue ยท 2 comments

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/lezer@0.13.5/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.

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