我有这个 yeoman 生成的 GruntFile.js。当我运行“grunt”时,dist 文件夹不会从 bower_components/*.js 更改我的所有脚本,只有其中一些。
这是 dist 文件夹中的 index.html 示例
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-resource.min.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-sanitize.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-animate.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-touch.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-route.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-messages.min.js"></script>
<script src="bower_components/angular-utf8-base64/angular-utf8-base64.js"></script>
<script src="bower_components/ng-table/ng-table.js"></script>
<script src="bower_components/lodash/dist/lodash.js"></script>
<script src="bower_components/angular-growl-v2/build/angular-growl.js"></script>
<script src="bower_components/nya-bootstrap-select/dist/js/nya-bs-select.js"></script>
如您所见,它没有找到要使用的正确 js 文件。我怎样才能解决这个问题?我的css文件也有同样的问题
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="bower_components/ng-table/ng-table.css">
<link rel="stylesheet" href="bower_components/angular-growl-v2/build/angular-growl.css">
<link rel="stylesheet" href="bower_components/nya-bootstrap-select/dist/css/nya-bs-select.css">
谢谢!如果您在我的 GruntFile.js 中发现任何其他错误或改进,请告诉我
编辑
这是我的 bower.json 文件
{
"name": "civilization-web",
"version": "0.0.0",
"dependencies": {
"angular": "~1.3.7",
"json3": "~3.3.1",
"es5-shim": "~3.1.0",
"bootstrap": "~3.3.1",
"angular-resource": "~1.3.7",
"angular-sanitize": "~1.3.7",
"angular-animate": "~1.3.7",
"angular-touch": "~1.3.7",
"angular-route": "~1.3.7",
"angular-utf8-base64": "~0.0.5",
"angular-messages": "~1.3.8",
"ng-table": "~0.3.3",
"angular-bootstrap": "~0.12.0",
"ng-file-upload": "~2.0.5",
"ng-file-upload-shim": "~2.0.5",
"lodash": "2.4.1",
"angular-growl-v2": "~0.7.3",
"nya-bootstrap-select": "~2.0.8"
},
"devDependencies": {
"angular-mocks": "~1.3.7",
"angular-scenario": "~1.3.7"
},
"appPath": "app",
"resolutions": {
"angular": "1.3.8"
}
}
这是我的 package.json
{
"name": "civilizationweb",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-autoprefixer": "^0.7.3",
"grunt-concurrent": "^0.5.0",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-connect": "^0.7.1",
"grunt-contrib-copy": "^0.5.0",
"grunt-contrib-cssmin": "^0.9.0",
"grunt-contrib-htmlmin": "^0.3.0",
"grunt-contrib-imagemin": "^0.8.1",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.4.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-filerev": "^0.2.1",
"grunt-google-cdn": "^0.4.0",
"grunt-karma": "^0.9.0",
"grunt-newer": "^0.7.0",
"grunt-ng-annotate": "^0.10.0",
"grunt-svgmin": "^0.4.0",
"grunt-usemin": "^2.1.1",
"grunt-wiredep": "^1.7.0",
"jshint-stylish": "^0.2.0",
"karma": "^0.12.24",
"karma-jasmine": "^0.1.5",
"karma-phantomjs-launcher": "^0.1.4",
"load-grunt-tasks": "^0.4.0",
"time-grunt": "^0.3.1"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "grunt test"
}
}