Jump to content
GreenSock

einomi

Members
  • Posts

    5
  • Joined

  • Last visited

einomi's Achievements

0

Reputation

  1. I mean that we have to include external library in transpiling process which is considered as a bad practise ? OK, great!
  2. It seems like jquery.gsap.js incorrectly determines stale param and then the message, I mentioned above, occurs. version = (TweenLite.version + ".0.0").split("."); //in case an old version of TweenLite is used that had a numeric version like 1.68 instead of a string like "1.6.8" stale = !(Number(version[0]) > 0 && Number(version[1]) > 7);
  3. How to import jquery.gsap? I'm trying require('gsap/src/uncompressed/jquery.gsap'); but it shows the following message: The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s). Version 2.0.1.0.0 is too old. Also the problem with const in production code still exists. Now we have to include node_modules/gsap folder in babel config, so it could be transpiled into ES5 code, but it's not correct. Despite const is supported by many browsers, it's not supported by IE 10 for example and is not a part of ES5 standard.
  4. I have the same situation as @Friebel. If I remove include line containing /node_modules/gsap/ from babel-loader config, then ES6 code appears in the bundle (for example, const statements). Here is the repo with webpack configuration and TweenMax imported as import { TweenMax } from 'gsap';. You can run build with yarn build and then inspect build/media/js/bundle.js https://github.com/sborkaproject/SP.Starter/
  5. Hello! I'm using create-react-app for my project and it started to complain about minifying GSAP modules when building production bundle. It happens because gsap modules are imported as ES6 modules, so UglifyJS fails to minify them. ES6 code also occurs in production bundle if I import GSAP modules as described above, so it will not be compatible with older browsers. There is a note about this issue in the documentation of create-react-app https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify I ended up creating aliases as described at the beginning of this topic.
×