Our project was using:
"builder": @angular-builders/custom-webpack:browser
for our build.
In our webpack.config.js we have this plugin:
/**
* report-result.js cannot be tree-shaked as part of the bundling process, since it actually runs as an global script.
* an empty stub file will be used to help reduce bundle size and improvement performance.
*/
new webpack.NormalModuleReplacementPlugin(
/(.*)proto\/report-result(.*)/,
function (resource) {
if (targetOptions.configuration === 'production') {
resource.request = resource.request.replace(
/report-result/,
'report-result-stub',
);
}
},
),
Now we have migrated to Angular 17 and want to use the deafault Angular CLI with this: "builder": "@angular-devkit/build-angular:application" (which is esbuild).
The question is, how can we achive the same functionality as we have in our webpack NormalModuleReplacementPlugin ?
As far as I can see, Angular does not allow you to customize esbuild or use plugins at all.
Thanks!