Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(patch) cannot import as es6 module #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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