Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

refactor: improve external module render for libraryType: module#19416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
JSerFeng wants to merge5 commits intowebpack:main
base:main
Choose a base branch
Loading
fromJSerFeng:refactor/improve-external-module-exports

Conversation

JSerFeng
Copy link
Contributor

@JSerFengJSerFeng commentedApr 11, 2025
edited
Loading

What kind of change does this PR introduce?

🚧 WIP...

improve output for external module oflibrary.type: module

Before:

import*as__WEBPACK_EXTERNAL_MODULE_externalfrom'external'__WEBPACK_EXTERNAL_MODULE_external.foo;

This PR:

import{foo}from'external'foo;

ExternalModule is imported thoughInitFragment, which will insert a namespace import, but user may want to keep the code as is

// inputimport{foo}from'external'foo;// outputimport*as__WEBPACK_EXTERNAL_MODULE_externalfrom'external'__WEBPACK_EXTERNAL_MODULE_external.foo;

As we know theexportsInfo, we can use them to improve the output.

IfexportsInfo.getUsedExports() equals:

  • true: used unknown exports from external module, fallback to namespace import like before
  • Set<string>: we know exactly used exports from external module, render them, we should also insert the exported specifier intoConcatenationScope.allUsedNames to avoid conflicts

Did you add tests for your changes?

WIP...

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

alexander-akait, hai-x, fi3ework, and ruiming reacted with heart emoji
@JSerFengJSerFeng changed the titlerefactor: named imports from external modulerefactor: improve external module render for libraryType: moduleApr 11, 2025
@JSerFengJSerFengforce-pushed therefactor/improve-external-module-exports branch from63a0edb to2ad9415CompareApril 15, 2025 11:36
@JSerFengJSerFeng marked this pull request as ready for reviewApril 16, 2025 09:10
@JSerFengJSerFeng marked this pull request as draftApril 18, 2025 09:21
@alexander-akait
Copy link
Member

@JSerFeng Hello, do you need help here?

@JSerFeng
Copy link
ContributorAuthor

Hello, do you need help here?

Oh, I just meet the problem that InitFragments inModuleConcatenationPlugin aren't analyzed. I'm trying another way, when I'm done I will request your review

alexander-akait reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@JSerFeng@alexander-akait

[8]ページ先頭

©2009-2025 Movatter.jp