I'm trying to import the jQuery plugin jQuery.scrollTo with JSPM.
So far I installed it with
jspm install npm:jquery.scrollto
and now I'm trying to import it with
import $ from 'jquery';
import scrollTo from 'jquery.scrollto';
Now I'm only getting
$(...).scrollTo is not a function
errors.
I tried to shim it, but I never did it before and can't find a good explanation how to do it, if it is necessary. Can you help me or show me a good explanation when and how do I need to shim things?
I tested on a clean project and here are the steps that i followed:
jspm install jquery
jspm install npm:jquery.scrollto -o "{format: 'global'}"
- (see this answer)add the imports in my
app.js
as described in the question.tested both from dev mode and from a self executing bundle with no errors.
You can clone a test repo I've put up here on Github, the steps to build are in the readme. Hope this helps.