我正在使用angular cli创建一个角度应用程序,当项目位于git子模块目录中时,我在ng build和ng serve命令中出错。
我有2个版本的项目。第一个是我原来的git存储库,我在那里为应用程序完成所有开发工作。对于SEO原因,我有一个额外的jekyll存储库来维护静态内容。为了使构建过程更容易,我尝试将角度存储库作为子模块包含在静态内容存储库中,因为这是问题所在启动。
出于某种原因,我可以在原始仓库中运行ng serve / build没有问题,但是当我尝试构建静态仓库时,我遇到了各种Web包问题,最近的问题是"找不到模块'的WebPack来源'"
我不确定为什么该项目正在工作'在一个地方而不是另一个地方,感觉两个地点应该具有完全相同的内容。任何帮助或想法将不胜感激。
我在两个目录中运行npm install都没有错误。这是项目的package.json(diff checker告诉我两个repos都是一样的)
原件:
{
"name": "inspinia",
"version": "2.7.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.3.6",
"@angular/common": "^4.3.6",
"@angular/compiler": "^4.3.6",
"@angular/core": "^4.3.6",
"@angular/forms": "^4.3.6",
"@angular/http": "^4.3.6",
"@angular/platform-browser": "^4.3.6",
"@angular/platform-browser-dynamic": "^4.3.6",
"@angular/platform-server": "^4.3.6",
"@angular/router": "^4.3.6",
"angularfire2": "^4.0.0-rc0",
"animate.css": "3.1.1",
"aws-sdk": "^2.110.0",
"bootstrap": "^3.3.7",
"chart.js": "^2.5.0",
"core-js": "^2.5.1",
"firebase": "^4.3.0",
"font-awesome": "^4.7.0",
"jquery": "^3.1.0",
"jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0",
"jvectormap": "1.2.2",
"metismenu": "^2.5.0",
"ng2-charts": "^1.5.0",
"ngx-bootstrap": "^1.9.1",
"peity": "^3.2.1",
"rxjs": "^5.4.3",
"webpack": "^3.5.6",
"zone.js": "^0.8.17"
},
"devDependencies": {
"@angular/cli": "^1.3.2",
"@angular/compiler-cli": "^4.3.6",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.88",
"codelyzer": "~2.0.0",
"extract-text-webpack-plugin": "^2.1.2",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.1.5"
}
}