[英]Does the Angular Compiler optimize string expressions?
That's the job of the minifier, noy the compiler.这是压缩器的工作,不是编译器。
For example Esbuild (a bundler used by angular) will do that for you:例如 Esbuild(angular 使用的打包器)会为你做这件事:
echo '[1].length > 0 ? true : false' | esbuild --loader=ts --minify
> [1].length>0;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.