8000 Fix module resolution for import call emit by rbuckton · Pull Request #41390 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

Fix module resolution for import call emit #41390

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2021
Merged

Fix module resolution for import call emit #41390

merged 1 commit into from
Jan 4, 2021

Conversation

rbuckton
Copy link
Contributor
@rbuckton rbuckton commented Nov 3, 2020

Fixes import() emit for bundled SystemJS/AMD output.

Fixes #37429

@rbuckton rbuckton requested a review from weswigham November 3, 2020 23:14
@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Nov 3, 2020
const argument = visitNode(firstOrUndefined(node.arguments), moduleExpressionElementVisitor);
const externalModuleName = getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
const firstArgument = visitNode(firstOrUndefined(node.arguments), moduleExpressionElementVisitor);
// Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really wanted to, couldn't we copy the quote style from the first argument string, if present?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't preserve quote-style on parse, and this is how we handle strings everywhere else (copy from source text if possible).

@rbuckton rbuckton merged commit 6fac3dd into master Jan 4, 2021
@rbuckton rbuckton deleted the fix37429 branch January 4, 2021 23:09
Zzzen pushed a commit to Zzzen/TypeScript that referenced this pull request Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

System or AMD module with outFile and dynamic import incorrect
3 participants
0