Lodash& Bower:指定下划线“替换”版本的最佳方式

时间:2014-12-08 12:14:10

标签: javascript bower lodash

我有点像一个凉亭。

使用bower安装lodash时,默认版本为 dist/lodash.compat.js ,但我想改为使用 dist / lodash.UNDERSCORE.js

有没有办法让bower i lodash参与使用下划线版本? (我不想编辑lodash package.json)

编辑:将第二个lodash变体更改为lodash.underscore.js

1 个答案:

答案 0 :(得分:1)

遗憾的是,您目前无法覆盖凉亭包中的默认“主”文件,但有一个open pull request for the bower.json spec that would let you do just that.

如果要使用未定义为main的bower包中的任何文件,则必须在脚本中手动指定它们的路径。

(还有一些其他的解决方案,但是如果你在像Gulp或Grunt这样的任务选手的情况下这样做的话。)

相关问题