I have this structure of an app (node_modules dir excluded from this list):
node_modules
├── actions.js ├── bundle.js ├── components │ ├── App.js │ ├── Foote
Just add it to your config. Source: https://www.jumoel.com/2017/zero-to-webpack.html
externals: [ nodeExternals() ]