gulp配合vue壓縮代碼格式化

實際項目就是一個單頁面。所以,我以爲用gulp足夠,而且不須要webpack和vue-cli由於沒有必要使用組件。css

先來講一下項目結構html

1.vue

而後來看看個人包管理package.json都用了啥,你也能夠複製下來,npm install進行安裝就好了。webpack

{
  "name": "webRoot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.25.0",
    "babel-preset-es2015": "^6.24.1",
    "gulp": "^3.9.1",
    "gulp-babel": "^7.0.0",
    "gulp-concat": "^2.6.1",
    "gulp-connect": "^5.0.0",
    "gulp-htmlmin": "^3.0.0",
    "gulp-imagemin": "^3.3.0",
    "gulp-jshint": "^2.0.4",
    "gulp-less": "^3.3.2",
    "gulp-minify-css": "^1.2.4",
    "gulp-notify": "^3.0.0",
    "gulp-rename": "^1.2.2",
    "gulp-uglify": "^3.0.0",
    "imagemin-pngcrush": "^5.1.0",
    "jshint": "^2.9.5"
  }
}

  而後是個人gulpfile.js配置web

這裏仍是用圖片吧,動手敲一敲總仍是好的,給之後的本身也找點麻煩。

  

內容很少,可是很實用,因此我不會放棄治療噠。vue-cli

相關文章
相關標籤/搜索