text: const path = require('path');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  // const ProgressBarPlugin = require('progress-bar-webpack-plugin');
  const VueLoaderPlugin = require('vue-loader/lib/plugin');
  
  const Components = require('../components.json');
  const config = require('./config');
  
  const webpackConfig = {
    mode: 'production',
    entry: Components,
    output: {
      path: path.resolve(process.cwd(), './lib'),
      publicPath: '/dist/',
      filename: '[name]/index.js',
      chunkFilename: '[id].js',
      libraryTarget: 'commonjs2'
    },
    resolve: {
      extensions: ['.js', '.vue', '.json'],
      alias: config.alias,
      modules: ['node_modules']
    },
    externals: config.externals,
    performance: {
      hints: false
    },
    stats: 'none',
    optimization: {
      minimize: false
    },
    module: {
      rules: [
        {
          test: /\.(jsx?|babel|es6)$/,
          include: process.cwd(),
          exclude: config.jsexclude,
          loader: 'babel-loader'
        },
        {
          test: /\.vue$/,
          loader: 'vue-loader',
          options: {
            compilerOptions: {
              preserveWhitespace: false
            }
          }
        },
        {test:/\.css$/, use: [MiniCssExtractPlugin.loader,'css-loader']},
        {
          test: /\.scss$/,
          use: [
            MiniCssExtractPlugin.loader,
            'css-loader',
            'sass-loader'
          ]
        },
        {
          test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
          loader: 'url-loader',
          query: {
            limit: 10000,
            name: path.posix.join('static', '[name].[hash:7].[ext]')
          }
        }
      ]
    },
    plugins: [
      // new ProgressBarPlugin(),
      new MiniCssExtractPlugin({
        // Options similar to the same options in webpackOptions.output
        // all options are optional
        filename: "[name]/style.css",
        chunkFilename: "[id].css",
      }),
      new VueLoaderPlugin()
    ]
  };
  
  module.exports = webpackConfig;
  