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'键 –