import type { UserConfigExport } from "@tarojs/cli" import HtmlWebpackPlugin from 'html-webpack-plugin'; import iframeCommunicationWebpackPlugin from 'webpack-plugin-iframe-communicator'; export default { logger: { quiet: false, stats: true }, mini: {}, h5: { devServer: { // 配置 HMR WebSocket 端口 client: { progress: true, webSocketURL: { pathname: '/mini-ws', port: 443, // 指定 HMR WebSocket 端口 }, }, open: false }, webpack:{ plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', }), iframeCommunicationWebpackPlugin({ hostOrigin: '*' // Trusted host origin }), ], }, } } satisfies UserConfigExport<'webpack5'>