webpack.config.js 860 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * @Author: xiaolin
  3. * @Date: 2022-10-14 10:31:52
  4. * @LastEditors: xiaolin
  5. * @LastEditTime: 2022-10-17 11:45:23
  6. * @Description: file content
  7. * @FilePath: \image.platform.com\xyxJsSdkV2\webpack.config.js
  8. */
  9. const TerserPlugin = require("terser-webpack-plugin");
  10. const path = require("path");
  11. const pkg = require("./package.json");
  12. module.exports = {
  13. entry: {
  14. dyMiniGameSdk: "./index.js",
  15. },
  16. experiments: {
  17. outputModule: true,
  18. },
  19. output: {
  20. filename: `[name].${pkg.version}.js`,
  21. path: path.resolve(__dirname, "dist"),
  22. library: {
  23. type: "module",
  24. },
  25. },
  26. optimization: {
  27. minimize: true,
  28. minimizer: [
  29. new TerserPlugin({
  30. terserOptions: {
  31. format: {
  32. comments: false,
  33. },
  34. },
  35. extractComments: false,
  36. }),
  37. ],
  38. },
  39. // devtool: 'source-map',
  40. };