pwmckenna / til

Today I Learned
http://pwmckenna.net
9 stars 8 forks source link

preserve dynamic requires in webpack #13

Open pwmckenna opened 8 years ago

pwmckenna commented 8 years ago

Last night Michael Jackson asked how to preserve a dynamic require in a webpack build that targets node.

https://twitter.com/mjackson/status/682698900407357440

I cobbled together a demo showing how to accomplish just that (assuming I'm understanding the question!).

https://github.com/pwmckenna/webpack-node-externals-demo

Please chime in. There was a noParse solution floating around, and I'd love to hear how they differ.