如何在browersify和gulp中将less和js文件捆绑在一起

时间:2015-04-28 11:14:55

标签: backbone.js less browserify

我使用package.json使用npm run build

将less和js文件捆绑在一起

我的Package.json文件:

    {
  "name": "margarita",
  "version": "0.0.1",
  "description": "prima",
  "scripts": {
    "build": "browserify ./app/scripts/app.js > ./app/bundle.js"
  },
  "browserify": {
    "transform": [
      "browserify-shim",
        "node-lessify",
      "hbsfy"
    ]
  },
  "browserify-shim": {
    "plugin": {
      "exports": "plugin",
      "depends": [
        "jquery:$"
      ]
    }
  },
  "bootstrap": {
          "path": "app/bower_components/bootstrap/dist/js/bootstrap.min.js",
          "exports": "bootstrap",
          "depends": [
            "jquery:$"
         ]
        },
  "devDependencies": {
    "browser-sync": "~2.2.2",
    "browserify": "^9.0.3",
    "browserify-shim": "^3.8.2",
    "coffeeify": "~1.0.0",
    "gulp": "^3.8.11",
    "gulp-autoprefixer": "^2.1.0",
    "gulp-changed": "^1.1.1",
    "gulp-filesize": "0.0.6",
    "gulp-iconfont": "^1.0.0",
    "gulp-imagemin": "^2.2.1",
    "gulp-less": "^3.0.3",
    "gulp-minify-css": "~0.5.1",
    "gulp-notify": "^2.2.0",
    "gulp-rename": "^1.2.0",
    "gulp-sass": "~1.3.3",
    "gulp-sourcemaps": "^1.5.0",
    "gulp-swig": "^0.7.4",
    "gulp-uglify": "^1.1.0",
    "gulp-util": "^3.0.4",
    "handlebars": "^3.0.0",
    "hbsfy": "~2.2.1",
    "karma": "^0.12.31",
    "karma-browserify": "^4.0.0",
    "karma-chrome-launcher": "^0.1.7",
    "karma-coffee-preprocessor": "^0.2.1",
    "karma-mocha": "^0.1.10",
    "karma-nyan-reporter": "0.0.51",
    "karma-sinon-chai": "^0.3.0",
    "lessify": "^1.0.1",
    "lodash": "^3.3.1",
    "merge-stream": "^0.1.7",
    "path": "^0.11.14",
    "pretty-hrtime": "~1.0.0",
    "require-dir": "^0.1.0",
    "vinyl-source-stream": "~1.0.0",
    "watchify": "^2.4.0"
  },
  "dependencies": {
    "backbone": "~1.1.2",
    "jquery": "~2.1.0"
  }
}

但是我收到了这个错误:

enter image description here

0 个答案:

没有答案