angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.74k stars 11.98k forks source link

Native support to pass additionnal options to angular-compiler plugin #28458

Open KeM1aL opened 3 days ago

KeM1aL commented 3 days ago

Which @angular/* package(s) are relevant/related to the feature request?

compiler

Description

I would like to enable a specific option to let me build a dependency. I need to pass deprecatedAssertSyntax = true and everything should be okay ... but I can't find a way to pass that option to the esbuild angular-compiler.

Proposed solution

Allow generic section to pass options to esbuild plugins

Alternatives considered

None

clydin commented 3 days ago

Can you provide additional information regarding the dependency you are trying to use? Without further information regarding the usage, enabling the ability to parse the syntax in third party libraries may not actually result in a working output. Import assertions were never standardized and were only supported in v8 based browsers but support has since been removed. No browser officially supported by Angular can be used with an import assertion. https://caniuse.com/mdn-javascript_statements_import_import_assertions

Would it be possible to raise an issue with the dependency to remove obsolete syntax that is not recommended for use?

KeM1aL commented 3 days ago

I've created an issue in the dependency repository : https://github.com/reown-com/appkit/issues/2880

But I try to find a way to use it before they release a new version including this change.

I can switch to webpack builder as I don't use ssr for now and maybe use Rules.Assert https://webpack.js.org/configuration/module/ But I don't know how to customize my webpack config.

I don't know a solution for esbuild