2
0

dev.ts 804 B

12345678910111213141516171819202122232425262728293031323334
  1. import type { UserConfigExport } from "@tarojs/cli"
  2. import HtmlWebpackPlugin from 'html-webpack-plugin';
  3. import iframeCommunicationWebpackPlugin from 'webpack-plugin-iframe-communicator';
  4. export default {
  5. logger: {
  6. quiet: false,
  7. stats: true
  8. },
  9. mini: {},
  10. h5: {
  11. devServer: {
  12. // 配置 HMR WebSocket 端口
  13. client: {
  14. progress: true,
  15. webSocketURL: {
  16. pathname: '/mini-ws',
  17. port: 443, // 指定 HMR WebSocket 端口
  18. },
  19. },
  20. open: false
  21. },
  22. webpack:{
  23. plugins: [
  24. new HtmlWebpackPlugin({
  25. template: './src/index.html',
  26. }),
  27. iframeCommunicationWebpackPlugin({
  28. hostOrigin: '*' // Trusted host origin
  29. }),
  30. ],
  31. },
  32. }
  33. } satisfies UserConfigExport<'webpack5'>