Skip to content

Webpack: Importing GSAP in multiple places returns empty object #261

Closed
@loilo

Description

@loilo

Bundling parts of GSAP (e.g. TweenLite.js) fails if done in multiple webpack entry points:

// in entry point A
import TweenLiteA from 'gsap/TweenLite'

// in entry point B
import TweenLiteB from 'gsap/TweenLite'

Now if you include both bundled entry points, A and B, in a HTML page, TweenLiteA will correctly point to the TweenLite function, however, TweenLiteB will be an empty object.

I made a minimal repro to make this issue easier to grasp, you can find it at Loilo/repro-webpack-gsap.

Note: While TweenLite is actually bundled in each a.js and b.js in the repro, the problem is the same when it's splitted out to a separate file and imported from there.

I'm not sure if this is an issue for the GreenSock or rather the webpack team — let me know if I can help with anything here. 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions