Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addModule(id, value) {
var fp = resolve(id, {cwd: root, prefix: prefix})
var res
if (fp) {
try {
res = require(fp)
} catch (error) {
throw fault(
'Cannot parse script `%s`\n%s',
relative(root, fp),
error.stack
)
}
try {
if (typeof res === 'function') {
addPlugin(res, value)