如何使用 bower 在 scrollmagic 中包含‘animation.gsap’

How to include ‘animation.gsap’ in scrollmagic using bower

TL;DR 有没有人能够使用 bower 安装 ScrollMagic + GSAP 动画?

我有一个网站,上面有完整的 roots stack (that means that I'm using bower for front-end dependency management and gulp to build the website.) and I'm trying to use ScrollMagic 动画。

其中一些动画将 greensock 库作为先决条件。所以我的 bower.json 有以下内容:

  "dependencies": {
    "bootstrap-sass": "3.3.6",
    "gsap": "GreenSock-JS#^1.18.2",
    "scrollmagic": "2.0.5"
  },

如果我 运行 gulp 浏览我的网站,我可以看到 main.js 中有对 GreenSock

的引用

根据 ScrollMagic 的 scrollmagic documentation It seems to me that I'm searching for "plugins/animation.gsap.js" but after reading the the oficial documentation....

选项 2:凉亭

Bower 上也提供 ScrollMagic,它只会安装必要的源代码,忽略所有示例和文档文件。 请注意,由于它们不是核心依赖项,如果您选择使用它们,则必须手动添加 GSAP、jQuery 或 Velocity 等框架。

所以很明显,通过 bower 安装 GSAP 库就足够了。

此外,我不确定 "gsap plugin" 是否与 "gsap library" 相同,但 bower registry 中似乎没有其他内容更适合。

谢谢!

ScrollMagic 默认的 bower include 似乎无法包含插件,因此需要进行一些覆盖。

任何人都应该能够按照此处的说明更改包含的文件: https://roots.io/using-bootstrap-with-bower-how-to-override-bower-packages/

我在这里创建了一个最小的工作 bower.json 文件作为要点: https://gist.github.com/MiquelAdell/9ffc8f1a9973b2308340

感谢 discourse.roots.io 的一些用户的帮助,我找到了我的答案。对话可以在这里找到: https://discourse.roots.io/t/how-to-include-animation-gsap-to-be-used-in-scrollmagic/5834