Blame view

build/webpack.dev.config.js 1.28 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, {
71eb889f   Graham Fairweather   Enable creation o...
15
16
      devtool: 'eval-source-map',
  
7fa943eb   梁灏   init
17
18
      // 入口
      entry: {
c9c5e751   huixisheng   [change] optimize...
19
          main: './examples/main',
7fa943eb   梁灏   init
20
21
22
23
          vendors: ['vue', 'vue-router']
      },
      // 输出
      output: {
c9c5e751   huixisheng   [change] optimize...
24
          path: path.join(__dirname, '../examples/dist'),
5af94c52   huixisheng   add HtmlWebpackPl...
25
          publicPath: '',
7fa943eb   梁灏   init
26
27
28
          filename: '[name].js',
          chunkFilename: '[name].chunk.js'
      },
7fa943eb   梁灏   init
29
      resolve: {
7fa943eb   梁灏   init
30
          alias: {
36fa7c6c   梁灏   update webpack co...
31
              iview: '../../src/index',
d1f37f12   梁灏   update
32
33
              vue: 'vue/dist/vue.esm.js'
              // vue: 'vue/dist/vue.runtime.js'
7fa943eb   梁灏   init
34
35
36
          }
      },
      plugins: [
5af94c52   huixisheng   add HtmlWebpackPl...
37
38
39
          new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' }),
          new HtmlWebpackPlugin({
              inject: true,
c9c5e751   huixisheng   [change] optimize...
40
41
              filename: path.join(__dirname, '../examples/dist/index.html'),
              template: path.join(__dirname, '../examples/index.html')
9b6ff1ce   huixisheng   add test and upda...
42
43
          }),
          new FriendlyErrorsPlugin()
7fa943eb   梁灏   init
44
      ]
c9c5e751   huixisheng   [change] optimize...
45
  });