Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
mapps-video

npm RaphaelPlugin webpack production build issue

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I try to include RaphaelPlugin from npm and build it with webpack. On the development everything works well, the plugin is included and all good. On production build though the RaphaelPlugin is missing from the build. I tried multiple ways to include the file, but still something is wrong in production. 

Any ideas?

 

import 'gsap/TweenLite';
import 'gsap/TweenMax';
import 'gsap/TimelineMax';
import * as RaphaelPlugin from 'gsap/umd/RaphaelPlugin';

 

Link to post
Share on other sites

Sorry about any confusion there - Raphael is quite old and doesn't appear to have been maintained for quite a few years (2016), so we phased that plugin out. I just checked, though, and it looks like there was a bug-fix release last March, but it doesn't really seem like it's something that many people use these days. I could be wrong. I'm curious - what are you using Raphael for these days? 

Link to post
Share on other sites
6 minutes ago, GreenSock said:

I'm curious - what are you using Raphael for these days? 

We have an animation application that uses Raphael.js for SVG manipulation and didn't really considered replacing it yet cause it does the job so far. 

 

Thanks for the update. 
The solution we have for the problem is including the RaphaelPlugin separately, but  I wanted to avoid this. 

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.2/plugins/RaphaelPlugin.min.js"></script>

More strange(or worse), was that this issue happens only with the production build. Now I haven't really digged into npm and webpack to see if that is the cause of it. 

 

If I compare RaphaelPlugin with the others, it seems to me that only the package naming is somehow an issue with npm

Link to post
Share on other sites

Yeah, there isn't an ES Module file for that plugin, nor is it exported from "gsap/all". That's probably the cause of the problem. But the way you're loading it is perfectly acceptable, plus you benefit from wider caching :)

Link to post
Share on other sites

Should I assume that this will never be included as an ES Module?

Link to post
Share on other sites
8 hours ago, mapps-video said:

Should I assume that this will never be included as an ES Module?

 

Correct, we don't have plans to do that at this point but it shouldn't be terribly difficult to take the UMD version and make it into an ES module. You've been "Shockingly Green" since 2017, which we sure appreciate, so let me know if you'd like me to convert that for you and I can send it to you privately. 

Link to post
Share on other sites
On 5/7/2019 at 9:46 PM, GreenSock said:

 

Correct, we don't have plans to do that at this point but it shouldn't be terribly difficult to take the UMD version and make it into an ES module. You've been "Shockingly Green" since 2017, which we sure appreciate, so let me know if you'd like me to convert that for you and I can send it to you privately. 

I would appreciate that very much :) Thanks!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×