2
要在服務器上部署我的角應用程序,我運行以下命令:ng build --prod
。但在我得到的dist文件夾中,我沒有index.html
文件。我想知道是否最好的做法是複製並粘貼我擁有的index.html
文件,或者是否有其他我缺少的文件。在apache服務器上部署角應用程序
angular-cli.json
{
"project": {
"version": "1.0.0-beta.28.3",
"name": "main"
},
"apps": [
{
"root": "src",
"outDir": "../../target/frontend",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"files": "src/**/*.ts",
"project": "src/tsconfig.json"
},
{
"files": "e2e/**/*.ts",
"project": "e2e/tsconfig.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}
構建正常或失敗? – Henry
構建是可以的。沒有錯誤顯示在控制檯 – edkeveked
@edkeveked'ng build --prod'應該有'index.html'。檢查你的'angular-cli.json'和'app'下面有'index'鍵 –