'In Angular 13 How to switch library build to .js output instead .mjs format

In Angular 13 the main app compiles in .js format but when we build library with ng build, output format are .mjs files

Can we build libs to .js with ng build in Angular 13?

I'm trying to use built .mjs library as custom plugin for webpack.config.ts in my other Angular project and have many errors: unknown file format .ts etc...

The project has latest @angular 13.x setup and @angular-builders/custom-webpack 13.x



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source