Force place your module into global if possible
- NPM
npm install --save force-global
- Yarn
yarn add force-global
// CommonJS
const { ForceGlobal } = require('force-global')
// ES6+
import ForceGlobal from 'force-global'
function add (a, b) {
return a + b
}
ForceGlobal('SuperAddNumber', add)
// Now you can access your global with function SuperAddNumber
MIT © M Habib Rohman