const path = require('path');
const webpack = require('webpack');
const terserWebpackPlugin = require('terser-webpack-plugin');

const { CleanWebpackPlugin } = require('clean-webpack-plugin');

module.exports = {
  mode: 'production',
  entry: {
    vue: [
      'axios',
      'core-js',
      'echarts',
      'echarts-wordcloud',
      'element-plus',
      'js-sha256',
      'vue',
      'vue-router',
    ],
  },
  output: {
    path: path.resolve(__dirname, 'dll'),
    filename: 'dll_[name].js',
    library: 'dll_[name]',
  },
  optimization: {
    minimizer: [
      new terserWebpackPlugin({
        extractComments: false,
      }),
    ],
  },
  plugins: [
    new CleanWebpackPlugin({
      path: path.join(__dirname, './dll'),
    }),
    new webpack.DllPlugin({
      name: 'dll+[name]',
      path: path.resolve(__dirname, './dll/[name].manifest.json'),
    }),
  ],
};

const a = [
  {
    value: 'zhinan',
    label: '指南',
    children: [
      {
        value: 'shejiyuanze',
        label: '设计原则',
        children: [
          {
            value: 'yizhi',
            label: '一致',
          },
          {
            value: 'fankui',
            label: '反馈',
          },
          {
            value: 'xiaolv',
            label: '效率',
          },
          {
            value: 'kekong',
            label: '可控',
          },
        ],
      }
    ],
  }
];
