Hell, I work with Magento 2, which is Magento 2 using requirejs.
I've tried my code in local without requirejs, it worked. But in magento with requirejs always fail with error in console.
I load in page on magento like this:
requirejs([ 'jquery', 'scrollmagic', 'tweenmax', 'timelinemax', 'sc.gsap' ], function($,ScrollMagic){ // my code here });
my console appear error
Script error for: sc.gsap
but if delete 'sc.gsap'
my console appear error
(intermediate value).setTween is not a function
Hell, I work with Magento 2, which is Magento 2 using requirejs. I've tried my code in local without requirejs, it worked. But in magento with requirejs always fail with error in console.
This is my requirejs.config.js
var config = { paths: { 'scrollmagic': 'scrollmagic/ScrollMagic.min', 'bootstrapjs': 'bootstrap/js/bootstrap.min', 'tweenmax' : 'scrollmagic/plugins/TweenMax.min', // 'timelinemax' : 'scrollmagic/plugins/TimelineMax.min', 'sc.gsap' : 'scrollmagic/plugins/animationgsap.min', 'tweenlite' : 'scrollmagic/plugins/TweenLite.min' }, shim: { 'scrollmagic': { 'deps': ['jquery', 'tweenmax'] }, 'bootstrapjs' : { 'deps' : ['jquery'] }, 'tweenmax': { 'exports': 'tweenmax' }, 'sc.gsap' : { 'deps': ['tweenmax', 'scrollmagic'], 'exports': 'sc.gsap' } } };
I load in page on magento like this:
requirejs([ 'jquery', 'scrollmagic', 'tweenmax', 'timelinemax', 'sc.gsap' ], function($,ScrollMagic){ // my code here });
my console appear error Script error for: sc.gsap
but if delete 'sc.gsap' my console appear error (intermediate value).setTween is not a function