Blame view

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

  var webpack = require('webpack');

1f9fbacf   Clark Du   add eslint config...
3
  var merge = require('webpack-merge');

c9c5e751   huixisheng   [change] optimize...
4
  var webpackBaseConfig = require('./webpack.base.config.js');

5e8a2915   jingsam   add umd library b...
5
  

676cdf84   huixisheng   fixed webpack bui...
6
  process.env.NODE_ENV = 'production';

c9c5e751   huixisheng   [change] optimize...
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
      plugins: [

676cdf84   huixisheng   fixed webpack bui...
29
          // @todo

5e8a2915   jingsam   add umd library b...
30
          new webpack.DefinePlugin({

1f9fbacf   Clark Du   add eslint config...
31
              'process.env.NODE_ENV': '"production"'

5e8a2915   jingsam   add umd library b...
32
33
34
35
36
          }),

          new webpack.optimize.UglifyJsPlugin({

              compress: {

                  warnings: false

              }

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

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

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