Blame view

build/webpack.dev.config.js 1.18 KB
7fa943eb   梁灏   init
1
2
3
4
5
6
  /**
   * 本地预览
   */
  
  var path = require('path');
  var webpack = require('webpack');
bd596e7a   huixisheng   support Steps
7
  // var ExtractTextPlugin = require('extract-text-webpack-plugin');
5af94c52   huixisheng   add HtmlWebpackPl...
8
  var HtmlWebpackPlugin = require('html-webpack-plugin');
c9c5e751   huixisheng   [change] optimize...
9
10
  var merge = require('webpack-merge')
  var webpackBaseConfig = require('./webpack.base.config.js');
9b6ff1ce   huixisheng   add test and upda...
11
  var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
7fa943eb   梁灏   init
12
  
c9c5e751   huixisheng   [change] optimize...
13
14
  
  module.exports = merge(webpackBaseConfig, {
7fa943eb   梁灏   init
15
16
      // 入口
      entry: {
c9c5e751   huixisheng   [change] optimize...
17
          main: './examples/main',
7fa943eb   梁灏   init
18
19
20
21
          vendors: ['vue', 'vue-router']
      },
      // 输出
      output: {
c9c5e751   huixisheng   [change] optimize...
22
          path: path.join(__dirname, '../examples/dist'),
5af94c52   huixisheng   add HtmlWebpackPl...
23
          publicPath: '',
7fa943eb   梁灏   init
24
25
26
          filename: '[name].js',
          chunkFilename: '[name].chunk.js'
      },
7fa943eb   梁灏   init
27
      resolve: {
7fa943eb   梁灏   init
28
          alias: {
36fa7c6c   梁灏   update webpack co...
29
30
              iview: '../../src/index',
              vue: 'vue/dist/vue.js'
7fa943eb   梁灏   init
31
32
33
          }
      },
      plugins: [
5af94c52   huixisheng   add HtmlWebpackPl...
34
35
36
          new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' }),
          new HtmlWebpackPlugin({
              inject: true,
c9c5e751   huixisheng   [change] optimize...
37
38
              filename: path.join(__dirname, '../examples/dist/index.html'),
              template: path.join(__dirname, '../examples/index.html')
9b6ff1ce   huixisheng   add test and upda...
39
40
          }),
          new FriendlyErrorsPlugin()
7fa943eb   梁灏   init
41
      ]
c9c5e751   huixisheng   [change] optimize...
42
  });