webpack.dll.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const terserWebpackPlugin = require('terser-webpack-plugin');
  4. const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  5. module.exports = {
  6. mode: 'production',
  7. entry: {
  8. vue: [
  9. 'axios',
  10. 'core-js',
  11. 'echarts',
  12. 'echarts-wordcloud',
  13. 'element-plus',
  14. 'js-sha256',
  15. 'vue',
  16. 'vue-router',
  17. ],
  18. },
  19. output: {
  20. path: path.resolve(__dirname, 'dll'),
  21. filename: 'dll_[name].js',
  22. library: 'dll_[name]',
  23. },
  24. optimization: {
  25. minimizer: [
  26. new terserWebpackPlugin({
  27. extractComments: false,
  28. }),
  29. ],
  30. },
  31. plugins: [
  32. new CleanWebpackPlugin({
  33. path: path.join(__dirname, './dll'),
  34. }),
  35. new webpack.DllPlugin({
  36. name: 'dll+[name]',
  37. path: path.resolve(__dirname, './dll/[name].manifest.json'),
  38. }),
  39. ],
  40. };
  41. const a = [
  42. {
  43. value: 'zhinan',
  44. label: '指南',
  45. children: [
  46. {
  47. value: 'shejiyuanze',
  48. label: '设计原则',
  49. children: [
  50. {
  51. value: 'yizhi',
  52. label: '一致',
  53. },
  54. {
  55. value: 'fankui',
  56. label: '反馈',
  57. },
  58. {
  59. value: 'xiaolv',
  60. label: '效率',
  61. },
  62. {
  63. value: 'kekong',
  64. label: '可控',
  65. },
  66. ],
  67. }
  68. ],
  69. }
  70. ];