I have this structure of an app (node_modules dir excluded from this list):
node_modules
├── actions.js ├── bundle.js ├── components │ ├── App.js │ ├── Foote
If you use multiple node_modules (yarn workspace etc), tell webpack where they are:
externals: [nodeExternals({ modulesDir: path.resolve(__dirname, '../node_modules'), }), nodeExternals()],