![](/img/trans.png)
[英]How to include resource files like css and js files in jhipster's angular app?
[英]How to add own css and js files to the build of Angular 2 App?
Angular 2自動將styles.css的鏈接添加到頭部,將一些腳本添加到index.html的主體末尾。
例如:
<script type="text/javascript" src="inline.bundle.js"></script>
<script type="text/javascript" src="polyfills.bundle.js"></script>
<script type="text/javascript" src="styles.bundle.js"></script>
<script type="text/javascript" src="vendor.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>
我可以在哪里配置Angular以將我自己的.css和.js文件添加到構建中? PS我正在使用CLI
打開angular-cli.json
文件並查找assets
數組。 推送您希望build
過程包含的文件內的鏈接。
"assets": [
"assets",
"favicon.ico",
"styles.css",
"d3.js",
],
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.