如何使用Browserify在Backbone项目中使用更少的文件?

时间:2015-04-27 09:38:14

标签: backbone.js less browserify

 var $ = require('jquery')(window);
var Handlebars = require('handlebars');
var Backbone = require('backbone');
Backbone.$ = $;

var header = require('templates/header.hbs');
require('../../styles/main.less');
require('../../../bower_components/bootstrap/less/bootstrap.less');
require('../../../bower_components/font-awesome/less/font-awesome.less');

  var headerView = Backbone.View.extend({
    el: $('#mainheader'),
    render: function(){

      var compiledTemplate = Handlebars.compile( header );
      // Append our compiled template to this Views "el"
      this.$el.append( compiledTemplate );
    }
  });

module.exports = new headerView();

我正在尝试使用browserify在Backbone项目中包含更少的文件。

当我创建bundle.js文件时,我收到以下错误:

enter image description here

0 个答案:

没有答案