Skip to content

[Feature]: [@babel/standalone] Add script nonce support #15668

@woody-li

Description

@woody-li

💻

  • Would you like to work on this feature?

What problem are you trying to solve?

Standalone package used in online editable code env.
The transformed scripts need a nonce to enable inline execution when using secure SCP without script-src-element: unsafe-inline.

Describe the solution you'd like

Is it possibile to add a nonce attribute support?
Example:
<script type="text/babel" nonce="nonce-xxxxx">

Cache the nonce value in loadScripts and set it to the new script element.

Describe alternatives you've considered

No feasible solutions have been found yet.

Documentation, Adoption, Migration Strategy

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: standalone

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions