Javascript 使用grunt和wiredep构建应用程序时更改库文件
我有从约曼角发电机角度应用 我在index.html中有这样的代码:Javascript 使用grunt和wiredep构建应用程序时更改库文件,javascript,gruntjs,bower,momentjs,wiredep,Javascript,Gruntjs,Bower,Momentjs,Wiredep,我有从约曼角发电机角度应用 我在index.html中有这样的代码: <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> ... <script src="bower_components/moment/moment.js"></script> ... <!-- endbower --> <!-- endbuild --> ... ... 然后在Grunfi
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
...
<script src="bower_components/moment/moment.js"></script>
...
<!-- endbower -->
<!-- endbuild -->
...
...
然后在Grunfile中:
wiredep: {
app: {
src: ['<%= yeoman.app %>/index.html'],
ignorePath: /\.\.\//
}
}
wiredep:{
应用程序:{
src:['/index.html'],
忽略路径:/\.\\//
}
}
问题是我的项目中不仅需要moment/moment.js,还需要min/moment-with-locales.js。当然,在index.html中手动更改也无济于事
也许有某种方法可以覆盖应该用于构建的库文件?解决方案似乎不是在Grunt任务中,而是在bower.json中。 我必须补充:
"overrides": {
"moment": {
"main": "min/moment-with-locales.js"
}
},
grunt将其添加到build中,所以问题得到了解决。解决方案似乎不是在grunt任务中,而是在bower.json中。 我必须补充:
"overrides": {
"moment": {
"main": "min/moment-with-locales.js"
}
},
格伦特补充说,这是为了建造,所以问题就解决了