Jump to content
GreenSock

radiator

Paid plugins with RollUp

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

Hi,

 

I recently switched from JSPM/SystemJS to Rollup for a few reasons and can't figure out how to get the paid plugins to work nicely with it. 

 

I installed gsap via npm for all the core stuff, and put ( for example ) the MorphSVGPlugin.js into a vendor folder, since that can't be installed via npm.

 

gsap instantiates and works just fine, but I can't seem to import the extras.

 

import 'gsap'
import '../../vendor/MorphSVGPlugin'

 

TweenMax works ( using rollup-plugin-node-resolve ) but I get 'invalid morphSVG tween value: .xxxx' 

 

The path to the morphSvg plugin is correct for me. And I tried a named import { MorphSVGPlugin }, * as morphSVG, * as MorphSVGPlugin, and just importing whole file as in code above.

 

Even if I dump the MorphSVG plugin into the node_modules folder ( not a good practice, but I tried it ) it still doesn't work.

 

Any suggestions? Thanks!

Link to comment
Share on other sites

Nevermind, resolved this - was a Rollup misconfig ( still new to it ).

 

I had to add my vendor directory to support cjs within Rollup

 

gulp.task('js' () => {
  return rollup.rollup({
    entry: "./src/js/theme.js",
    plugins: [
      ...
      cjs({
        include: [
          'node_modules/**',
          'src/js/vendor/**' // <-- BINGO
        ]
      }),
      ...
  })
    .then(function (bundle) {
      ...
    })
});

 

 

  • Like 2
Link to comment
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.
×