UNPKG

als-require

Version:

A utility for using CommonJS require in the browser and creating bundles.

11 lines (10 loc) 471 B
// testModule.js if (typeof customContext !== 'undefined') { module.exports = { result: 'Success', contextValue: customContext.customKey }; } else if(typeof firstContext !== 'undefined') { module.exports = { result: 'Success', contextValue: firstContext.data }; } else if(typeof secondContext !== 'undefined') { module.exports = { result: 'Success', contextValue: secondContext.data }; } else { module.exports = { result: 'No context provided' }; }