使用vue-cli腳手架新建的項目中,含有package.json。css
package.json是npm的配置文件,裏面設定了腳本以及項目依賴的庫。 npm run dev 這樣的命令就寫在package.json裏。html
1 { 2 "name": "vue-manage", // 項目名稱 3 "version": "1.0.0", // 版本 4 "description": "Reimbursement Manage", // 描述 5 "author": "LXG", // 做者 6 "private": true, //是否私人項目 7 "scripts": { 8 "dev": "node build/dev-server.js", // npm run dev 的 dev,使用node執行 build/dev-server.js 9 "start": "node build/dev-server.js", // npm run start 跑的是一樣的命令 10 "build": "node build/build.js", // npm run build 跑的是 node build/build.js // 如下腳本爲單元測試用到的腳本 11 // 如下腳本爲單元測試用到的腳本 12 "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", 13 "e2e": "node test/e2e/runner.js", 14 "test": "npm run unit && npm run e2e" 15 }, 16 "dependencies": { // dependencies 設定的是項目裏使用的依賴 17 "vue": "^2.2.6", 18 "vue-router": "^2.3.1", 19 "element-ui": "1.3.1", 20 "vue-datasource": "1.0.9", 21 "axios": "^0.15.3", 22 "vue-core-image-upload": "2.1.5", 23 "mockjs": "^1.0.1-beta3", 24 "babel-polyfill": "^6.23.0" 25 }, 26 "devDependencies": { //devDependencies設定的是開發使用的依賴 27 "autoprefixer": "^6.7.2", // 是用於給css3屬性自動加屬性前綴的 28 "babel-core": "^6.22.1", // babel相關的都是用於處理es6語法的 29 "babel-loader": "^6.2.10", 30 "babel-plugin-transform-runtime": "^6.22.0", 31 "babel-preset-env": "^1.3.2", 32 "babel-preset-stage-2": "^6.22.0", 33 "babel-register": "^6.22.0", 34 "chalk": "^1.1.3", // chalk適用於格式化輸出命令行信息的,好比run dev之後的start... 35 "connect-history-api-fallback": "^1.3.0", 36 "copy-webpack-plugin": "^4.0.1", 37 "css-loader": "^0.28.0", // 全部的*-loader都是 webpack的擴展,webpack是把各類資源理解爲一個模塊,css-loader就是讀取css模塊的加載器 38 "eslint": "^3.19.0", // eslint 相關是代碼格式化檢查工具,開啓之後要嚴格遵守它規定的格式進行開發 (我通常把它關了,爲了顯示特地加上的) 39 "eventsource-polyfill": "^0.9.6", 40 "express": "^4.14.1", // express 用於啓動 node http server的服務 41 "extract-text-webpack-plugin": "^2.0.0", 42 "file-loader": "^0.11.1", 43 "friendly-errors-webpack-plugin": "^1.1.3", 44 "html-webpack-plugin": "^2.28.0", // webpack 裏載入和處理html的插件 45 "http-proxy-middleware": "^0.17.3", // node server 的中間件工具 46 "webpack-bundle-analyzer": "^2.2.1", 47 "cross-env": "^4.0.0", // 設定環境變量的工具,NODE_ENV變量跟它有關 48 "karma": "^1.4.1", // karma相關的都是單元測試工具 49 "karma-coverage": "^1.1.1", 50 "karma-mocha": "^1.3.0", 51 "karma-phantomjs-launcher": "^1.0.2", 52 "karma-phantomjs-shim": "^1.4.0", 53 "karma-sinon-chai": "^1.3.1", 54 "karma-sourcemap-loader": "^0.3.7", 55 "karma-spec-reporter": "0.0.30", 56 "karma-webpack": "^2.0.2", 57 "lolex": "^1.5.2", 58 "mocha": "^3.2.0", 59 "chai": "^3.5.0", 60 "sinon": "^2.1.0", 61 "sinon-chai": "^2.8.0", 62 "inject-loader": "^3.0.0", 63 "babel-plugin-istanbul": "^4.1.1", 64 "phantomjs-prebuilt": "^2.1.14", 65 "chromedriver": "^2.27.2", 66 "cross-spawn": "^5.0.1", 67 "nightwatch": "^0.9.12", 68 "selenium-server": "^3.0.1", // 一個版本檢查工具 69 "semver": "^5.3.0", // selljs是在node裏跑shell命令的工具,好比‘rm -rf’ 70 "shelljs": "^0.7.6", 71 "opn": "^4.0.2", // 跨平臺的開啓文件或者網頁的工具 72 "optimize-css-assets-webpack-plugin": "^1.3.0", 73 "ora": "^1.2.0", // 命令行裏自動運行的信息提示 74 "rimraf": "^2.6.0", // 跑shell命令 rm-rf 的工具 75 "url-loader": "^0.5.8", // 配合webpack的加載器 76 "vue-loader": "^11.3.4", // 配合webpack的加載器 77 "vue-style-loader": "^2.0.5", // 配合webpack的加載器 78 "vue-template-compiler": "^2.2.6", // vue-template-compiler,多是配合離線版vue 79 "webpack": "^2.3.3", // webpack相關的用於,把圖片,*.vue, *.js, 這些組合成最終的項目,webpack-dev用於跑測試服務器 80 "webpack-dev-middleware": "^1.10.0", 81 "webpack-hot-middleware": "^2.18.0", 82 "webpack-merge": "^4.1.0", 83 "babel-preset-es2015": "^6.22.0", 84 "function-bind": "^1.1.0", 85 "webpack-bundle-analyzer": "^2.2.1" 86 }, // 項目依賴的引擎版本 87 "engines": { 88 "node": ">= 4.0.0", 89 "npm": ">= 3.0.0" 90 }, 91 "browserslist": [ 92 "> 1%", 93 "last 2 versions", 94 "not ie <= 8" 95 ] 96 }
原文連接:http://blog.csdn.net/lucky_lxg/article/details/71629199vue