Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.
This repository was archived by the owner on May 16, 2025. It is now read-only.

Allow google closure self-managed js dynamic imports #72

Description

@MorganDream

Google Closure Library has a dynamic imports engine --- goog.module.ModuleManager, which can be used to lazy loading JS resource. This engine is different from webpack, thus it should be handled without webpackJsonp.

I have used ModuleManager successfully to realize JS lay loading with closure-webpack-plugin, only in case where entry chunks have no common dependence.
I have to use CommonChunksPlugin When entry chunks have common dependence, as mentioned in Readme. But webpack tries to handle child chunk(lazy loading chunk) with webpackJsonp, which will cause child chunk lazy loading failure. The reason is below:

if (parentChunk !== null) {
return `${defParts[0]}:webpackJsonp([${
chunk.id
}], function(__wpcc){%s});`;
} else if (chunk) {
return `${defParts[0]}:${entryChunkWrapper}`;
}

I suggest adding an option: entryChunks to use entryChunkWrapper instead of webpackJsonp.
Could you grant me pull request permission? I have done implemented it locally. @ChadKillingsworth

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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