【发布时间】:2018-01-01 20:28:33
【问题描述】:
我的 index.html 文件 post ng build 有以下文件
<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>
如何让 Angular cli 在 src 文件夹位置添加“app”,例如src="/app/vendor.bundle.js"
我需要进行上述更改,因为我正在从以“/app/”开头的文件系统位置将所有静态资产加载到 dropwizard 中
以下是我的 angular-cli.json 供参考
angular-cli.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "web"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/font-awesome/css/font-awesome.min.css",
"../node_modules/primeng/resources/themes/ludvig/theme.css",
"../node_modules/primeng/resources/primeng.min.css",
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"defaults": {
"styleExt": "css",
"component": {}
}
}
【问题讨论】:
-
你能添加你的 .angular-cli.json 配置文件吗?
-
嗨@Maxouhell,我在上面添加了angular-cli内容
标签: angular angular-cli