Skip to content

Instantly share code, notes, and snippets.

@faceyspacey
Created July 28, 2017 07:53
Show Gist options
  • Select an option

  • Save faceyspacey/37b4b2da536259f1ee4e188b24960695 to your computer and use it in GitHub Desktop.

Select an option

Save faceyspacey/37b4b2da536259f1ee4e188b24960695 to your computer and use it in GitHub Desktop.
proposal for webpack requireWeak function
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