在查看bower.json时,我假设在devDependencies
中放置内容是处理单元测试依赖项等事情的推荐方法。我想使用qunit作为我的测试框架,但我想它也应该适用于其他框架。
我遇到的问题是当我在devDependencies中放入qunit时,在构建vendor.js
时它不会被拾取。这是预期的,但那我怎么去问早午餐呢?显然,我更喜欢test-vendor.js
我有依赖+ devDependencies,同时保持devDependencies不在vendor.js
。
我在config.coffee
:
exports.config =
# See http://brunch.readthedocs.org/en/latest/config.html for documentation.
files:
javascripts:
joinTo:
'javascripts/app.js': /^app/
'javascripts/vendor.js': /^(bower_components|vendor)/
'test/javascripts/test.js': /^test\/(?!vendor)/
'test/javascripts/test-vendor.js': /^test\/(?=vendor)/
显然,最后一行不会按原样获取任何bower_component项。这里有什么建议吗?
我看到了这张票:
但它看起来仍然悬而未决。
这个SOq:
表示目前没有办法从凉亭方面做到这一点。
答案 0 :(得分:1)
在Brunch中本地实现之前,只要您不使用Windows,就可以像这样破解它:
ln -s ../bower_components/qunit/qunit.js test/
然后,依赖关系将包含在您的unit-tests.js中。
当brunch支持devDependencies时,您可以删除符号链接。
答案 1 :(得分:0)
请参阅Ignore directories in brunch production build
您应该可以执行以下操作:
overrides:
production:
conventions:
ignored: /[\/\\]_|bower_components[\/\\]qunit/
然后使用brunch b -P
(brunch build --production
)