Skip to content

Instantly share code, notes, and snippets.

@garmjs
Created January 6, 2019 20:16
Show Gist options
  • Save garmjs/7939212858992785f523430878e29b7f to your computer and use it in GitHub Desktop.
Save garmjs/7939212858992785f523430878e29b7f to your computer and use it in GitHub Desktop.
Make working scrollMagic and GSAP on Gatsby
// put this on gatsby-node.js file
exports.onCreateWebpackConfig = ({
stage,
rules,
loaders,
plugins,
actions,
}) => {
actions.setWebpackConfig({
resolve: {
modules: ['node_modules'],
alias: {
TweenLite: 'gsap/src/minified/TweenLite.min.js',
TweenMax: 'gsap/src/minified/TweenMax.min.js',
TimelineLite: 'gsap/src/minified/TimelineLite.min.js',
TimelineMax: 'gsap/src/minified/TimelineMax.min.js',
ScrollMagic: 'scrollmagic/scrollmagic/minified/ScrollMagic.min.js',
'animation.gsap':
'scrollmagic/scrollmagic/minified/plugins/animation.gsap.min.js',
'debug.addIndicators':
'scrollmagic/scrollmagic/minified/plugins/debug.addIndicators.min.js',
},
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment