运行ng build
将创建以下内容:
<html>
<head></head>
<body>
<app></app>
<script type="text/javascript" src="/public/client/runtime.09b569c0ccb2e6f4674d.js"></script>
<script type="text/javascript" src="/public/client/polyfills.f2bc2612562878ce4ca1.js"></script>
<script type="text/javascript" src="/public/client/main.a0c64004d4c4f3d21210.js"></script>
</body>
</html>
但是我希望使用head
属性将脚本放入defer
中,例如:
<html>
<head>
<script defer type="text/javascript" src="/public/client/runtime.09b569c0ccb2e6f4674d.js"></script>
<script defer type="text/javascript" src="/public/client/polyfills.f2bc2612562878ce4ca1.js"></script>
<script defer type="text/javascript" src="/public/client/main.a0c64004d4c4f3d21210.js"></script>
</head>
<body>
<app></app>
</body>
</html>
是否可以在Angular中完成而无需编写自己的海关脚本?