如何在我的package.json文件中包含扩展名

时间:2016-08-08 08:04:49

标签: json npm package

我想在我的package.json文件

中加入此扩展程序ol3-layerswitcher

我的package.json:

{
  "name": "TEST",
  "version": "1.0.0",
  "description": "OpenLayers 3",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "beefy app.js:bundle.js --live",
    "compile:dev": "./node_modules/.bin/browserify app.js -o bundle.js",
    "compile:prod": "./node_modules/.bin/browserify app.js | uglifyjs > bundle.js"
  },
  "author": "test",
  "license": "MIT",
  "dependencies": {
    "jquery": "^3.1.0",
    "jquery-ui": "^1.12.0",
    "openlayers": "^3.17.1",
    "ol3-layerswitcher": "^1.0.2"
  },
  "devDependencies": {
    "browserify": "^13.0.0",
    "uglify-js": "^2.7.0",
    "beefy": "^2.1.8"
  }
}

1 个答案:

答案 0 :(得分:0)

添加以下行:

  "dependencies": {
    "jquery": "^3.1.0",
    "jquery-ui": "^1.12.0",
    "ol3-layerswitcher": "git://github.com/walkermatt/ol3-layerswitcher.git",
    "openlayers": "^3.17.1"
  }