faceyspacey/redux-first-router-demo

Use webpack-node-externals

codepunkt opened this issue · 4 comments

Shouldn't it be possible to use webpack-node-externals instead of the self-made solution to provide an externals definition using the whitelist option?

Yes something is wrong with that package or even webpack itself. It needs to be gotten to the bottom of.

It also could be the regex we whitelist but I've tried several.

Basically we wanna look at the regexes the plugin actually passes to webpack. U may need to open up the plugin in node modules and add debugging there.

I wasn't sure what you meant, but now that i've tried webpack-node-externals , it doesn't work the way i expected it would.

we declare externals so webpack doesn't include them in the bundle and define them as commonjs so the bundled code can load them from node_modules when executed. we want to declare this for all node_modules except for those in the regexp.

to be able to debug the usage of webpack-node-externals a little better, please help me out here:

  1. why do we need to ignore modules? the code comment doesn't really explain it to me.
  2. why those 4, especially why .bin?
  1. we ignore them so they run within webpack's closure and get access to webpack variables such as __webpack_modules__ and __webpack_require__. These are essentially internal methods used to require modules without marking them as dependencies.

  2. .bin has commands that never go in the webpack bundle.

no pressure brother. really. it's something i prolly gotta take a deeper look at myself, and maybe even fork it. what would help is just to know what's wrong with the situation causing this.