This would only be true if your import statement looked like this
import moment from './moment'
Anything not prefixed with a directory structure lookup (e.g.
../, etc.) is automatically looked for in
node_modules as a third-party dependency.
So, theoretically, you could import the MomentJS library and import your own moment file as well
import moment from 'moment'
import localMoment from './moment'
In the case of not having first installed momentJS, webpack would throw an error on that first line that it cannot resolve the module ‘moment’—even if you have a local
moment.js file in src.
Really awesome post here! Thanks for creating it :)