resolve path/dependency issues when used with browser globals but as npm module