text: const path = require('path');
  const os = require('os');
  const webpack = require('webpack');
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  const HappyPack = require('happypack');
  var happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length });
  
  
  function resolve(dir) {
      return path.join(__dirname, dir);
  }
  
  module.exports = {
      entry: {
          main: '@/main',
          'vender-base': '@/vendors/vendors.base.js',
          'vender-exten': '@/vendors/vendors.exten.js'
      },
      output: {
          path: path.resolve(__dirname, '../webapp/webapp')
      },
      module: {
          rules: [{
                  test: /\.vue$/,
                  loader: 'vue-loader',
                  options: {
                      loaders: {
                          less: ExtractTextPlugin.extract({
                              use: ['css-loader?minimize', 'autoprefixer-loader', 'less-loader'],
                                  fallback: 'vue-style-loader'
                          }),
                      },
                      loaders: {
                          css: 'vue-style-loader!css-loader',
                          less: 'vue-style-loader!css-loader!less-loader'
                      },
                      postLoaders: {
                          html: 'babel-loader'
                      }
                  }
              },
              {
                  test: /iview\/.*?js$/,
                  loader: 'happypack/loader?id=happybabel',
                  exclude: /node_modules/
              },
              {
                  test: /\.js$/,
                  loader: 'happypack/loader?id=happybabel',
                  exclude: /node_modules/
              },
              {
                  test: /\.js[x]?$/,
                  include: [resolve('src')],
                  exclude: /node_modules/,
                  loader: 'happypack/loader?id=happybabel'
              },
              {
                  test: /\.css$/,
                  use: ExtractTextPlugin.extract({
                      use: ['css-loader?minimize', 'autoprefixer-loader'],
                      fallback: 'style-loader'
                  })
              },
              {
                  test: /\.less$/,
                  use: ExtractTextPlugin.extract({
                      use: ['autoprefixer-loader', 'less-loader'],
                      fallback: 'style-loader'
                  }),
              },
              {
                  test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
                  loader: 'url-loader',
                  options: {
                      limit: 0,
                      //name: utils.assetsPath('img/[name].[hash:7].[ext]')
                  }
              },
              {
                  test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
                  loader: 'url-loader',
                  options: {
                      limit: 0,
                      //name: utils.assetsPath('media/[name].[hash:7].[ext]')
                  }
              },
              {
                  test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
                  loader: 'url-loader',
                  options: {
                      limit: 0,
                      //name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
                  }
              },
              // {
              //     test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/,
              //     loader: 'url-loader?limit=1024'
              // },
              {
                  test: /\.(html|tpl)$/,
                  loader: 'html-loader'
              }
          ]
      },
      plugins: [
          new HappyPack({
              id: 'happybabel',
              loaders: ['babel-loader'],
              threadPool: happyThreadPool,
              verbose: true
          })
      ],
      resolve: {
          extensions: ['.js', '.vue'],
          alias: {
              'vue': 'vue/dist/vue.esm.js',
              '@': resolve('../src'),
          }
      }
  };