generated from Richienb/node-module-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Background: Create React App comes with a ModuleScopePlugin which ensures that relative imports from app's source directories don't reach outside of it, meaning whatever you're importing has to be either in src/ or node_modules.
But our plugin node-polyfill-webpack-plugin uses webpack require.resolve, which returns the absolute path of packages
If we trying to use console or path polyfill with CRA
function App() {
console.log('Hello world');
path.join('./assets/img', 'logo.png');
return (
<div className="App">
....
</div>
);
}CRA would report error
I created a reproduce repository here node-polyfill-webpack-plugin-cra-reproduce
Some other info
- yarn version: 1.22.15
- node version: v16.16.0
CMunkyDev, Pasniczy, ksavery, jeremyckahn, fmorency and 1 more
Metadata
Metadata
Assignees
Labels
No labels

