如何指定用於涼亭組件的默認文件,以便通過grunt-bower-install正確注入?爲組件配置Grunt-Bower-Install路徑
我正在與datejs合作,根據您的本地化他們有不同的文件。我想包括的文件不在bower_components根/ datejs目錄,所以我得到的錯誤:
datejs was not injected in your file.
Please go take a look in "app/bower_components/datejs" for the file you need, then manually include it in your file.
我想我最難避免硬編碼datejs到我的索引文件並沒有真正想要將「date-en-US.js」文件移動到datejs目錄的根目錄中。
這是datejs涼亭組件的結構。
bower_components
└── datejs
└── build
└── ...
└── date-en-US.js
└── ...
└── src
└── test
和公正的情況下,這會有所幫助,這是位於datejs的.bower.json文件涼亭組件路徑:
{
"name": "datejs",
"homepage": "https://github.com/datejs/Datejs",
"_release": "7bdddb55d6",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "7bdddb55d69719e42c358c3a2b7df706ff3090f8"
},
"_source": "git://github.com/datejs/Datejs.git",
"_target": "*",
"_originalSource": "datejs",
"_direct": true
}
確實!關於[wiredep](https://github.com/taptapship/wiredep#bower-overrides)的更多解釋,請參閱[grunt-wiredep](https://github.com/stephenplusplus/grunt-wiredep#behind-幕後)。 Thx @nknj – pgu