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

Plugin does not work with JSPM & ES6 or Babel in any browser but Chrome #453

Closed
linnett opened this issue Sep 25, 2015 · 4 comments
Closed

Comments

@linnett
Copy link

linnett commented Sep 25, 2015

I've been trying to use this plugin with JSPM and es6-module-loader/systemjs but I get an error. It does, however, work in Chrome - but not in any other browser. It also doesn't work when compiled with Babel.
I installed through the usual JSPM route (jspm install github:imakewebthings/waypoints) and then import the plugin into my JS file at the top.

I then get an error saying "Potentially unhandled rejection [2]".

Any ideas? I can confirm other plugins work with my build

@imakewebthings
Copy link
Owner

I don't know what JSPM expects, but this "plugin" currently does not provide a CommonJS, AMD, or ES6+ export. It hangs everything off of window like an animal. I suspect you'll need to use the word shim somewhere.

@peduarte
Copy link

😂😂😂😂😂😂😂😂😂

It hangs everything off of window like an animal.

Agree the plugin should be updated to provide CommonJS, AMD and es6 support.

@imakewebthings
Copy link
Owner

Closing this in favor of #458. Please see the discussion there.

@rlvandaveer
Copy link

For those folks looking to leverage this framework using jspm here is how you do it.

jQuery
jspm install npm:waypoints -o "{ main: 'lib/jquery.waypoints.min.js', shim: { 'lib/jquery.waypoints.min.js': ['jquery'] } }"

`import "waypoints";

let foopoint = new Waypoint({...`

I have not tested the following but it should be something like this:

No Framework
jspm install npm:waypoints -o "{ main: 'lib/waypoints.min.js' , format: 'cjs' }"

`import Waypoint from "waypoints";

let foopoint = $("#foo").waypoint({...`

It is my bet that Zepto support would be similar to jQuery's.

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

No branches or pull requests

4 participants