Blame view

build/webpack.dist.prod.config.js 957 Bytes
5e8a2915   jingsam   add umd library b...
1
2
  var path = require('path');

  var webpack = require('webpack');

c9c5e751   huixisheng   [change] optimize...
3
4
  var merge = require('webpack-merge')

  var webpackBaseConfig = require('./webpack.base.config.js');

5e8a2915   jingsam   add umd library b...
5
  

c9c5e751   huixisheng   [change] optimize...
6
7
8
  

  

  module.exports = merge(webpackBaseConfig, {

5e8a2915   jingsam   add umd library b...
9
10
11
12
13
14
15
16
17
18
19
      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...
20
      externals: {

8879f859   jingsam   fixed umd
21
22
23
24
25
26
          vue: {

              root: 'Vue',

              commonjs: 'vue',

              commonjs2: 'vue',

              amd: 'vue'

          }

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

5e8a2915   jingsam   add umd library b...
28
29
30
31
32
33
34
35
36
37
      plugins: [

          new webpack.DefinePlugin({

              'process.env': {

                  NODE_ENV: '"production"'

              }

          }),

          new webpack.optimize.UglifyJsPlugin({

              compress: {

                  warnings: false

              }

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

5e8a2915   jingsam   add umd library b...
39
      ]

c9c5e751   huixisheng   [change] optimize...
40
  });