Jump to content


  • Posts

  • Joined

  • Last visited


3 Newbie
  1. Hi @GreenSock, sorry for the late response – was on holidays for the week. I don't know of any risks of adding it to the package.json. I think it would make it much more intuitive to many of us, if it would 'just work', without using the /umd/ files.
  2. OK, I found the solution: Browserify expects commonJS modules Babelify runs before the final Browserify process and converts all es6 modules to commonJS – files inside node_modules are ignored by default GSAP V2 uses es6 modules and resides inside node_modules, which caused the errors Adding this to the package.json of the npm GSAP solves this: "browserify": { "transform": ["babelify"] } Could you please put this inside by default? Could save a lot of people some trouble.
  3. So, I found the cause of this: https://github.com/babel/babelify#why-arent-files-in-node_modules-being-transformed Are you guys planning to pre-compile gsap for babelify/browserify, soon?
  4. ...This also creates problems when I use premium plugins like the ThrowPropsPlugin. I have to re-write this line: import { TweenLite, _gsScope, TweenPlugin, Ease } from "gsap/TweenLite.js"; to import { TweenLite, _gsScope, TweenPlugin, Ease } from "../gsap/TweenLite.js"; ...making it also reference the relative folder outside the default node_modules location.
  5. Hi there, I'm having problems once again with babelify and gsap. When importing any file from gsap: import TweenLite from 'gsap/TweenLite'; ...I keep getting this error in the console: SyntaxError: 'import' and 'export' may only appear at the top level (22:0) while parsing [...]/node_modules/gsap/TweenLite.js [...] is my local path. The file exists. It works just fine, if I copy the full gsap folder in my project and reference it relatively: import TweenLite from '../gsap/TweenLite'; This is not related to the many issues in the internet, that are being solved by installing `babel-preset-es2015`. (One example: https://github.com/babel/babelify/issues/157#issuecomment-188146766)
  6. Hi Craig, ok thank you, I think in this case I will have to write a callback function for the snap property and determine which element is closest to the value. Thanks again for your hints!
  7. Hi there, just got a club license to use the amazing ThrowPropsPlugin in combination with `draggable` and `type`:`scroll`. Now I would very much like an option to make the scrolling snap to certain elements, if flicked. Is there an option or approach for this?
  8. Thanks guys, your work is greatly appreciated! I sometimes work without a decent internet connection, that's why I tend to import everything locally. But you are right, using a CDN for the production site totally makes sense. Again, thank you!!
  9. Yes, I saw your post over at GitHub. Thanks so much for trying to work it out!
  10. Hi Jack, so this is the reply that I got from the guys over at browserify: https://github.com/substack/node-browserify/issues/1686#issuecomment-279503986 They claim it's gsap, you say it's browserify... I would be happy to help, but sadly I am not firm enough for that kind of thing.
  11. So – I somehow "fixed" the problem. I replaced this line in both files: import TweenLite from 'gsap'; with import 'gsap/TweenMax'; Any idea why?
  12. If you are interested, you can test it yourself. I am really puzzled about this. browserify assets/js/script1.js -o dist/js/script1.js -t babelify browserify assets/js/script2.js -o dist/js/script2.js -t babelify ...and here are the two source files: https://rassohilber.com/debug/tweenlite/assets/js/script1.js https://rassohilber.com/debug/tweenlite/assets/js/script2.js When I switch out the order of the two scripts are embedded in my html page, the last included always doesn't work. `TweenLite` is only an empty object in the second included file.
  13. OK, thanks again for your feedback. I will report back as soon as I have found out about what happens there.
  14. Thanks for your response! I just set up another test, using Flickity twice from two different files: https://rassohilber.com/debug/flickity/ This works without any problems. Maybe this helps finding the solution?
  15. Hi there, I set up a test case on my server: https://rassohilber.com/debug/tweenlite/ There are two scripts included on the page, both importing TweenLite from the same npm gsap package. The first animates the .el-1, the second should animate .el-2. If you open the console, you see what I mean (the second script errors). Sorry for saying, TweenLite pollutes the global namespace. I didn't really know what I was talking about there EDIT: I should maybe add that I am using watchify with babelify transform. EDIT #2: ...but the babelify transform doesn't make a difference, just tested it without it.