有没有一种方法可以指定将ng build文件输出到index.html中的哪个位置?

时间:2019-02-18 01:18:31

标签: angular

运行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中完成而无需编写自己的海关脚本?

0 个答案:

没有答案