我从早午餐与卓别林样板开始,但我想在混合物中添加 sinon 和 qunit。所以我将它们添加到bower.json
并安装它们bower install <lib>
。它工作得非常顺利,但现在我想访问这样的功能:
Model = require './model'
module.exports = class Collection extends Chaplin.Collection
# Mixin a synchronization state machine.
# _(@prototype).extend Chaplin.SyncMachine
# initialize: ->
# super
# @on 'request', @beginSync
# @on 'sync', @finishSync
# @on 'error', @unsync
# Use the project base model per default, not Chaplin.Model
model: Model
initialize: ->
@on 'request', @reply
reply: ->
console.log QUnit # this works
console.log Sinon # this error's
console.log 'requested'
更新:
当我手动构建时brunch build
出现错误
error: [Error: Component JSON file
"/Users/Simon/Development/myparcel/data/myparcel/bower_components/sinon/.bower.json"
must have `main` property.
See https://github.com/paulmillr/read-components#README]
所以我"main":"sinon.js"
没有任何运气就添加到文件中。