TLDR
Is there a plug-in for Webpack that let's your bring in the module foo/bar/baz
using only require('baz')
?
FULL
I just came across an interesting plug-in for Babel/NPM:
https://github.com/CentaurWarchief/babel-plugin-global-require
This plug-in let's you require your NPM modules using only the most-specific part of the module's path. For instance, if your filesystem has:
src
util
foo
Bar.js
instead of doing:
require('src/util/foo/Bar');
you can just do:
require('Bar');
If (for instance) you happen to have two "Bar.js" files, you can instead do:
require('foo/bar');
That's awesome ... if you use NPM as your module system. But I'm looking to switch to using Webpack, so my question is: does anything like I just described exist as a Webpack plug-in?