您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

53 行
1.4 KiB

  1. /**
  2. * @prettier
  3. */
  4. /** Dev Note:
  5. * StatsWriterPlugin is disabled by default; uncomment to enable
  6. * when enabled, rebuilding the bundle will cause error for assetSizeLimit,
  7. * which we want to keep out of CI/CD
  8. * post build, cli command: npx webpack-bundle-analyzer <path>
  9. */
  10. import configBuilder from "./_config-builder"
  11. import { DuplicatesPlugin } from "inspectpack/plugin"
  12. import { WebpackBundleSizeAnalyzerPlugin } from "webpack-bundle-size-analyzer"
  13. // import path from "path"
  14. // import { StatsWriterPlugin } from "webpack-stats-plugin"
  15. const result = configBuilder(
  16. {
  17. minimize: true,
  18. mangle: true,
  19. sourcemaps: true,
  20. includeDependencies: false,
  21. },
  22. {
  23. entry: {
  24. "swagger-ui-es-bundle-core": [
  25. "./src/index.js",
  26. ],
  27. },
  28. output: {
  29. globalObject: "this",
  30. library: "SwaggerUIBundle",
  31. libraryTarget: "commonjs2",
  32. },
  33. plugins: [
  34. new DuplicatesPlugin({
  35. // emit compilation warning or error? (Default: `false`)
  36. emitErrors: false,
  37. // display full duplicates information? (Default: `false`)
  38. verbose: false,
  39. }),
  40. new WebpackBundleSizeAnalyzerPlugin("log.es-bundle-core-sizes.swagger-ui.txt"),
  41. // new StatsWriterPlugin({
  42. // filename: path.join("log.es-bundle-core-stats.swagger-ui.json"),
  43. // fields: null,
  44. // }),
  45. ]
  46. }
  47. )
  48. export default result