Created
July 28, 2017 07:53
-
-
Save faceyspacey/37b4b2da536259f1ee4e188b24960695 to your computer and use it in GitHub Desktop.
proposal for webpack requireWeak function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const requireWeak = (modulePath) => { | |
| try { | |
| const moduleId = require.resolveWeak(modulePath) | |
| return __webpack_require__(moduleId) | |
| } | |
| catch (err) { | |
| return null | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment