-
Notifications
You must be signed in to change notification settings - Fork 27
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
Document how to load Banana with ES6 native modules #76
Comments
To answer my own issue and for the benefit of others, it would be great if a sample ES6 module like the below (which is now working for me) could be documented in Banana's documentation:
In your Then, you import this module from (e.g.) your main |
I'm finding that importing JSON files is supported in very few browsers, and the bundling system has issues with it too, so it's better to use old-fashioned XHR or else Fetch as per documentation. And while this works with native ES6 modules, my bundler (Rollup) doesn't seem capable of bundling banana-i18n due to lack of exports. Does anyone know how to make a wrapper to provide an export? I tried:
After bundling, this produces the error that Banana is not a constructor... But it works fine with native modules. Go figure. |
Hey, I had been working on the migration of a chrome extension from manifest V2 to V3 , and apparently it shows that the |
There doesn't appear to be any information. Doing something like:
import { Banana } from '../node_modules/banana-i18n/dist/banana-i18n.js';
... results in an error
The requested module '/node_modules/banana-i18n/dist/banana-i18n.js' does not provide an export named 'Banana'
...The text was updated successfully, but these errors were encountered: