Blame view

build/webpack.dev.config.js 1.25 KB
7fa943eb   梁灏   init
1
2
3
4
  /**
   * 本地预览
   */
  
4a7f28fd   Sergio Crisostomo   eslint and replac...
5
6
7
8
9
10
11
  const path = require('path');
  const webpack = require('webpack');
  // const ExtractTextPlugin = require('extract-text-webpack-plugin');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const merge = require('webpack-merge');
  const webpackBaseConfig = require('./webpack.base.config.js');
  const 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
              iview: '../../src/index',
d1f37f12   梁灏   update
30
31
              vue: 'vue/dist/vue.esm.js'
              // vue: 'vue/dist/vue.runtime.js'
7fa943eb   梁灏   init
32
33
34
          }
      },
      plugins: [
5af94c52   huixisheng   add HtmlWebpackPl...
35
36
37
          new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' }),
          new HtmlWebpackPlugin({
              inject: true,
c9c5e751   huixisheng   [change] optimize...
38
39
              filename: path.join(__dirname, '../examples/dist/index.html'),
              template: path.join(__dirname, '../examples/index.html')
9b6ff1ce   huixisheng   add test and upda...
40
41
          }),
          new FriendlyErrorsPlugin()
7fa943eb   梁灏   init
42
      ]
c9c5e751   huixisheng   [change] optimize...
43
  });