未捕获的TypeError:无法读取属性'延伸'未定义的 - Gulp

时间:2015-08-26 11:37:09

标签: javascript backbone.js gulp browserify

    gulp.task('javascript', function(){
    return browserify({
        debug: true,
        transform: [hbsfy],
        entries: [src_js],
    })
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(buffer())
    .pipe(sourcemaps.init({loadMaps : true}))
    .pipe(uglify())
    .on('error', gutil.log)
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest(get_dist_path("js")));
});

当我使用gulp构建Backbone文件时

我收到以下错误:未捕获的TypeError:无法读取属性' extend'未定义的

编辑:Package.json文件

 {
  "name": "vini",
  "version": "1.0.0",
  "description": "### Create front end ###",
  "dependencies": {
    "backbone": "^1.1.2",
    "backbone-validation": "^0.11.5",
    "backbone.paginator": "^2.0.2",
    "bootstrap": "^3.3.4",
    "browserify": "^10.1.0",
    "del": "^1.1.1",
    "font-awesome": "^4.3.0",
    "gulp": "^3.8.11",
    "gulp-less": "^3.0.3",
    "gulp-minify-css": "^1.1.1",
    "gulp-rename": "^1.2.2",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-uglify": "^1.2.0",
    "gulp-util": "^3.0.4",
    "handlebars": "^3.0.3",
    "handlebars-paginate": "^0.1.0",
    "hbsfy": "^2.2.1",
    "jquery": "^2.1.4",
    "process": "^0.11.0",
    "vinyl-buffer": "^1.0.0",
    "vinyl-source-stream": "^1.1.0"
  },
  "browser": {
    "bootstrap": "./node_modules/bootstrap/dist/js/bootstrap.js"
  },
  "browserify": {
    "transform": [
      "browserify-shim",
      "hbsfy"
    ]
  },
  "browserify-shim": {
    "bootstrap": {
      "depends": [
        "jquery:$"
      ]
    }
  },
  "devDependencies": {
    "browserify-shim": "^3.8.6",
    "canvas-browserify": "^1.1.1",
    "chart.js": "^1.0.2",
    "handlebars-registrar": "^1.4.1",
    "moment": "^2.10.3"
  },
  "main": "Gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "",
  "license": "ISC"
}

0 个答案:

没有答案