Open
requested to merge github/fork/ldeninski/bugfix/add-missing-cjs-extension-to-webpack-config into main
Created by: ldeninski
This PR adds the missed .cjs extension to the webpack config loader section. According to webpack docs found here to force the module type of a file you can use the .cjs extension similarly to .mjs for ESM. Without this extension explicitly added to the loader test rule, packages using .cjs file as a main
in there package.json will not work at all. The index.cjs file is picked up by the file loader and treated as an asset. A good example of this behavior are all prosemirror packages witch are not usable in CRA app.
I tested my changes on a the codebase of a relatively complex project I am working on and the change is not breaking anything so far. Sorry but I cannot share screens from this project :)