Skip to content

Conversation

@cristinecula
Copy link

this is undefined when imported as es6 module.

Include detection from umd: https://github.com/umdjs/umd/blob/master/templates/amdWeb.js

This makes importing as es6 module work:

import 'money';
window.fx.convert(...)

Ideally the module should be rewritten to export fx directly, instead of registering to window, but this gets the job done.

import { fx } from 'money'
fx.convert(...)

`this` is undefined when imported as es6 module

Include detection from umd: https://github.com/umdjs/umd/blob/master/templates/amdWeb.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant