Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Feature Request]: renderDynamicImport hook #4532

Copy link
Copy link

Description

@michielpauw
Issue body actions

What problem does this feature solve?

In our Rollup build, we use the renderDynamicImport hook to identify a specific dynamic import, to manipulate this for a later stage of the build. The manipulation itself can be done using the transform hook. However, correctly identifying this import requires the options.targetModuleId and options.moduleId properties passed to renderDynamicImport.

Example:

renderDynamicImport(options) {
  if (
    !options.targetModuleId &&
    options.moduleId.includes('/some/dynamic/import')
  ) {
    return { left: 'import(/* webpackIgnore: true */', right: ')' };
  }
  return undefined;
},

What does the proposed API look like?

Implement renderDynamicImport with the same API as Rollup: https://rollupjs.org/plugin-development/#renderdynamicimport

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.