Blame view

build/webpack.dist.prod.config.js 1.23 KB
4a7f28fd   Sergio Crisostomo   eslint and replac...
1
2
3
4
5
  const path = require('path');

  const webpack = require('webpack');

  const merge = require('webpack-merge');

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

  const CompressionPlugin = require('compression-webpack-plugin');

5e8a2915   jingsam   add umd library b...
6
  

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

c9c5e751   huixisheng   [change] optimize...
8
9
  

  module.exports = merge(webpackBaseConfig, {

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

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

              root: 'Vue',

              commonjs: 'vue',

              commonjs2: 'vue',

              amd: 'vue'

          }

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

5e8a2915   jingsam   add umd library b...
29
      plugins: [

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

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

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

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

          new webpack.optimize.UglifyJsPlugin({

              compress: {

                  warnings: false

              }

0a0971da   huixisheng   use gzip
38
39
40
41
42
43
44
          }),

          new CompressionPlugin({

              asset: '[path].gz[query]',

              algorithm: 'gzip',

              test: /\.(js|css)$/,

              threshold: 10240,

              minRatio: 0.8

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

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

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