新航路师徒学院

 找回密码
 立即注册
搜索
查看: 507|回复: 2

【新航路】Webpack package.json

[复制链接]

80

主题

114

帖子

560

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
560
发表于 2016-8-26 19:35:35 | 显示全部楼层 |阅读模式
  1. {
  2.   "name": "note-app-vuejs-vuex",
  3.   "version": "1.0.0",
  4.   "description": "A notes application built using VueJs and Vuex",
  5.   "main": "index.js",
  6.   "repository": {
  7.     "type": "git",
  8.     "url": "https://github.com/coligo-io/notes-app-vuejs-vuex.git"
  9.   },
  10.   "scripts": {
  11.     "dev": "webpack-dev-server --inline --hot",
  12.     "build": "webpack -p"
  13.   },
  14.   "keywords": [
  15.     "vuejs",
  16.     "vuex",
  17.     "notes"
  18.   ],
  19.   "author": "Fady Makram",
  20.   "license": "MIT",
  21.   "devDependencies": {
  22.     "babel-core": "^6.7.6",
  23.     "babel-loader": "^6.2.4",
  24.     "babel-plugin-transform-runtime": "^6.7.5",
  25.     "babel-preset-es2015": "^6.6.0",
  26.     "babel-runtime": "^5.8.38",
  27.     "css-loader": "^0.23.1",
  28.     "vue-hot-reload-api": "^1.3.2",
  29.     "vue-html-loader": "^1.2.2",
  30.     "vue-loader": "^8.2.3",
  31.     "vue-style-loader": "^1.0.0",
  32.     "webpack": "^1.12.15",
  33.     "webpack-dev-server": "^1.14.1"
  34.   },
  35.   "dependencies": {
  36.     "vue": "^1.0.21",
  37.     "vuex": "^0.6.2"
  38.   }
  39. }
复制代码
回复

使用道具 举报

80

主题

114

帖子

560

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
560
 楼主| 发表于 2016-8-26 19:37:22 | 显示全部楼层
  1. {
  2.   "name": "testvb",
  3.   "version": "1.0.0",
  4.   "description": "A notes application built using VueJs and Vuex",
  5.   "main": "index.js",
  6.   "scripts": {
  7.     "test": "echo \"Error: no test specified\" && exit 1"
  8.   },
  9.   "repository": {
  10.     "type": "git",
  11.     "url": "https://github.com/coligo-io/notes-app-vuejs-vuex.git"
  12.   },
  13.   "author": "",
  14.   "license": "ISC",
  15.   "dependencies": {
  16.     "webpack": "^1.13.1"
  17.   },
  18.   "devDependencies": {
  19.     "css-loader": "^0.23.1",
  20.     "image-webpack-loader": "^2.0.0",
  21.     "style-loader": "^0.13.1",
  22.     "webpack": "^1.13.1",
  23.     "webpack-dev-server": "^1.14.1"
  24.   }
  25. }
复制代码
回复 支持 反对

使用道具 举报

80

主题

114

帖子

560

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
560
 楼主| 发表于 2017-2-8 15:03:17 | 显示全部楼层
  1. // webpack.config.js
  2. var path = require('path')
  3. var webpack = require('webpack');

  4. module.exports = {
  5.   entry: ['./src/entry'],
  6.   output: {
  7.     path: path.join(__dirname, 'dist'),
  8.     filename: 'bundle.js'
  9.   },
  10.   plugins: [
  11.     new webpack.optimize.UglifyJsPlugin({
  12.       compressor: {
  13.         warnings: false,
  14.       },
  15.     })
  16.   ],
  17.   module: {
  18.     loaders: [{
  19.       test: /\.css$/,
  20.       loaders: ['style', 'css']
  21.     },
  22.     {
  23.         test: /\.(png|jpg)$/,
  24.         loaders: [
  25.             'file?hash=sha512&digest=hex&name=[hash].[ext]',
  26.             'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
  27.         ]
  28.     }]
  29.   }
  30. }
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

新航路师徒学院 ( 京ICP备16035622号

GMT+8, 2018-6-23 10:12 , Processed in 0.136438 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表