fix(@ngtools/webpack): emit require in replace resources when using CommonJS as module#18719
fix(@ngtools/webpack): emit require in replace resources when using CommonJS as module#18719alan-agius4 merged 1 commit intoangular:masterfrom alan-agius4:unreferenced-import
require in replace resources when using CommonJS as module#18719Conversation
require in replace resources when using…require in replace resources when using CommonJS as module
… CommonJS as module
When using CommonJs as module format TypeScript will generate unreferenced `require` when using `ts.createImportDeclaration`.
```js
const external_component_html_1 = require("!raw-loader!./external.component.html");
const core_1 = require("@angular/core");
let ExampleComponent = class ExampleComponent {
};
ExampleComponent = __decorate([
core_1.Component({
selector: 'example-compoent',
template: __NG_CLI_RESOURCE__0,
})
], ExampleComponent);
```
More context: microsoft/TypeScript#18369 (comment)
Closes #18718
|
hi @alan-agius4 , I have an issue which is introduced by this PR. Maybe worth to ask you here before opening an issue. The issue is: However, the line If switching to Is it a bug or is it intended behavior ? My question is: is it possible that |
|
Hi @ahnpnl, using the mentioned transformer is a private API and is not meant to be used outside and without |
|
Thanks for the quick answer! I will just copy the source and modify in the way I want :) |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When using CommonJs as module format TypeScript will generate unreferenced
requirewhen usingts.createImportDeclaration.More context: microsoft/TypeScript#18369 (comment)
Closes #18718