Skip to content

feat(nf): Add esmsInitOptions to Angular builder to inject additional esms-module-shims options into index.html #498

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

Conversation

jogelin
Copy link
Contributor

@jogelin jogelin commented Mar 11, 2024

Current Behaviour

During the transformation of the index.html by the builder, only the following options are specified for the esms-module-shims:

image

It is not possible to specify other options from the documentation: https://github.com/guybedford/es-module-shims?tab=readme-ov-file#init-options

Expected

Because the esms-module-shims is inside the polyfills and the options are injected by the builder, we should be able to add other options like mapOverrides for instance ;)

Implementation

  • Add new options esmsInitOptions to the schema.json which is an object of the same type ESMSInitOptions
  • Provide the options to the updateScriptTags function
  • By default, use {shimMode: true}

Alternatives

  • Use the skipHtmlTransform and specify the options manually in the index.html. But that means we should also duplicate the rest of the code of the updateScriptTags function.

…al `sms-module-shims` options into `index.html`
@jogelin jogelin force-pushed the add-builder-esms-init-options branch from 252e172 to 40849a5 Compare March 11, 2024 11:04
@manfredsteyer manfredsteyer merged commit 7edb1f1 into angular-architects:main Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants