Open yougotashovel opened 7 years ago
Same problem here (I'm using ReactJS's create-react-app utility to create my project, I'm not using Webpack). Any solution?
@alide create-react-app uses webpack you just can't see it until you eject, which then allows you to see the webpack configuration files.
For anyone needing a work around:
npm run eject
config/webpack.config.dev.js
and config/webpack.config.prod.js
module.exports = {
...
resolve: {
...
alias: {
"TweenLite": path.resolve('node_modules', 'gsap/src/uncompressed/TweenLite.js'),
"TweenMax": path.resolve('node_modules', 'gsap/src/uncompressed/TweenMax.js'),
"TimelineLite": path.resolve('node_modules', 'gsap/src/uncompressed/TimelineLite.js'),
"TimelineMax": path.resolve('node_modules', 'gsap/src/uncompressed/TimelineMax.js'),
"ScrollMagic": path.resolve('node_modules', 'scrollmagic/scrollmagic/uncompressed/ScrollMagic.js'),
"animation.gsap": path.resolve('node_modules', 'scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js'),
"debug.addIndicators": path.resolve('node_modules', 'scrollmagic/scrollmagic/uncompressed/plugins/debug.addIndicators.js'),
},
...
},
...
}
Double dependency issues caused by this:
import { TweenMax, ... } from 'gsap'
like instructed in tutorials TweenMax will get included in the bundle twice from two different locations in node_modules
.import { TimelineMax, Sine } from 'TweenMax'
import ScrollMagic from 'scrollmagic'
import 'animation.gsap'
import 'debug.addIndicators'
hey @yougotashovel i followed this step but still get some error Module not found: Can't resolve 'animation.gsap'
Any solution ?
With this PR you dont have to eject
react #684
hey @yougotashovel i followed this step but still get some error Module not found: Can't resolve 'animation.gsap'
Any solution ?
@wisnuprayoga Did you ever figure this out? Ran into this issue.
hey @yougotashovel i followed this step but still get some error Module not found: Can't resolve 'animation.gsap' Any solution ?
@wisnuprayoga Did you ever figure this out? Ran into this issue.
yups i just follow @yougotashovel instruction and it works
@yougotashovel I've ejected from create-react-app npm run eject
but cannot locate config/webpack.config.dev.js
or config/webpack.config.prod.js files
.
Does anyone know where they are located?
I found it: 'myprojectpath\node_modules\react-scripts/config/webpack.config.js'
Although I don't see dev or prod.js
version however it still fixed the issue.
Trying to use GSAP plugin with ScrollMagic in webpack. ScrollMagic works fine on its own, can't get the plugins to work.
Have tried a few variations of the above, no luck yet.
Here's the current error:
Anybody know why? Thanks