Skip to content
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

feat(es/minifier): Support format.inline_script #8252

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Nov 9, 2023

This serves as a partial solution for issue #7602, should we proceed, the implementation of ends_with will be needed.

crates/swc_ecma_codegen/src/lib.rs Outdated Show resolved Hide resolved
@kdy1 kdy1 added this to the Planned milestone Nov 9, 2023
@kdy1 kdy1 changed the title feat: support inline_script feat(es/minifier): Support format.inline_script Nov 9, 2023
@kdy1 kdy1 self-assigned this Nov 9, 2023
@@ -75,6 +75,52 @@ where
pub wr: W,
}

fn replace_close_inline_script(raw: &str) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

This is still unconditional. Can we check for the existence of the pattern and return Cow::Borrowed(raw) if it's not found?

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Thanks!


swc-bump:

  • swc_ecma_codegen

@kdy1 kdy1 enabled auto-merge (squash) November 14, 2023 21:05
@swc-bot swc-bot requested a review from a team as a code owner November 14, 2023 21:06
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit f059270 into swc-project:main Nov 14, 2023
279 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.3.98 Nov 21, 2023
@caorushizi
Copy link

Why doesn't inline_script work when I use it.
image

@kdy1
Copy link
Member

kdy1 commented Dec 3, 2023

It works. The red line is about typescript typings

@caorushizi
Copy link

It really doesn't work. The left side is the input, the right side is the output. Code is not formatted successfully.
image

@swc-project swc-project locked as resolved and limited conversation to collaborators Jan 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants