2
0

dev.ts 812 B

1234567891011121314151617181920212223242526272829303132
  1. import type { UserConfigExport } from "@tarojs/cli"
  2. export default {
  3. logger: {
  4. quiet: false,
  5. stats: true
  6. },
  7. mini: {},
  8. h5: {
  9. devServer: {
  10. port: 10087,
  11. // 配置 HMR WebSocket 端口
  12. client: {
  13. progress: true,
  14. webSocketURL: {
  15. pathname: '/talent-mini-ws',
  16. port: 443, // 指定 HMR WebSocket 端口
  17. },
  18. },
  19. open: false
  20. },
  21. webpackChain(chain, webpack) {
  22. // 确保在 HtmlWebpackPlugin 之后添加
  23. chain
  24. .plugin('iframeCommunicationPlugin')
  25. .use(require('webpack-plugin-iframe-communicator').default, [{
  26. hostOrigin: '*',
  27. }])
  28. .after('htmlWebpackPlugin'); // 指定在 htmlWebpackPlugin 之后执行
  29. }
  30. }
  31. } satisfies UserConfigExport<'webpack5'>