Blame view

build/webpack.dist.prod.config.js 1.29 KB
5e8a2915   jingsam   add umd library b...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  var path = require('path');

  var webpack = require('webpack');

  

  module.exports = {

      entry: {

          main: './src/index.js'

      },

      output: {

          path: path.resolve(__dirname, '../dist'),

          publicPath: '/dist/',

          filename: 'iview.min.js',

          library: 'iview',

          libraryTarget: 'umd',

          umdNamedDefine: true

      },

e1134de2   jingsam   not bundle vue in...
16
      externals: {

8879f859   jingsam   fixed umd
17
18
19
20
21
22
          vue: {

              root: 'Vue',

              commonjs: 'vue',

              commonjs2: 'vue',

              amd: 'vue'

          }

e1134de2   jingsam   not bundle vue in...
23
      },

5e8a2915   jingsam   add umd library b...
24
      resolve: {

9e74a856   梁灏   update webpack co...
25
          extensions: ['.js', '.vue']

5e8a2915   jingsam   add umd library b...
26
27
      },

      module: {

9e74a856   梁灏   update webpack co...
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
          rules: [

              {

                  test: /\.vue$/,

                  loader: 'vue-loader',

                  options: {

                      postLoaders: {

                          html: 'babel-loader'

                      }

                  }

              },

              {

                  test: /\.js$/,

                  loader: 'babel-loader', exclude: /node_modules/

              }

          ]

5e8a2915   jingsam   add umd library b...
43
44
45
46
47
48
49
50
51
52
53
      },

      plugins: [

          new webpack.DefinePlugin({

              'process.env': {

                  NODE_ENV: '"production"'

              }

          }),

          new webpack.optimize.UglifyJsPlugin({

              compress: {

                  warnings: false

              }

fcf37f49   梁灏   update webpack & ...
54
          })

5e8a2915   jingsam   add umd library b...
55
56
      ]

  }