-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed as not planned
Labels
area: @angular-devkit/build-angulardevkit/build-angular:browserfeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Description
Command
build, config
Description
Looking at the script config https://angular.io/guide/workspace-config#style-script-config there does not seem to be any way to add the scripts as type="module" for esm.
If the third party script is delivered as an Es Module it cant be imported in the angular.json.
Seems like there is some thought about this
angular-cli/packages/angular_devkit/build_angular/src/utils/index-file/augment-index-html.ts
Line 94 in d086d17
| if (isModule) { |
This comment may be the one of why it won't add type="module"
angular-cli/packages/angular_devkit/build_angular/src/utils/index-file/augment-index-html.ts
Line 79 in d086d17
| // Also, non entrypoints need to be loaded as no module as they can contain problematic code. |
Describe the solution you'd like
Add a new setting to the script config, something like.
"scripts": [
{
"input": "node_modules/third-party/esm-script.js",
"inject": true,
"scriptType": "module"
}
],
Describe alternatives you've considered
- can not use angular.json and
- manually add a script tag or
- just import the module in the Angular module code
deep7102, LilBiggs, ThomOrlo, EdwardCoyle, danielortiz1982 and 35 more
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/build-angulardevkit/build-angular:browserfeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
