liady / webpack-node-externals

Easily exclude node modules in Webpack
MIT License
1.3k stars 62 forks source link

Need help with more details on how this webpack-node-externals works #62

Open dmngu9 opened 5 years ago

dmngu9 commented 5 years ago

According to Readme, webpack-node-externals exclude any node_modules on server side.

I have a React SSR project and in webpack config for server side, I added this plugin in externals fields. On server side, I still need 'react' and 'react-dom' and react-apollo. It works fine but it suddenly makes me confused if all node_modules are excluded , how come react, react dom still work on server side?

Then I added a third party react component library and suddenly all exported stuff from it on server is undefined.

Please help me with my understanding