| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import type { UserConfigExport } from "@tarojs/cli"
- export default {
- logger: {
- quiet: false,
- stats: true
- },
- compiler: {
- // 关闭开发模式的依赖预编译,减少主包体积以支持微信小程序开发版预览(2MB限制)
- prebundle: {
- enable: false
- }
- },
- mini: {},
- h5: {
- devServer: {
- port: 10087,
- // 配置 HMR WebSocket 端口
- client: {
- progress: true,
- webSocketURL: {
- pathname: '/talent-mini-ws',
- port: 443, // 指定 HMR WebSocket 端口
- },
- },
- open: false
- },
- webpackChain(chain) {
- // 确保在 HtmlWebpackPlugin 之后添加
- chain
- .plugin('iframeCommunicationPlugin')
- .use(require('webpack-plugin-iframe-communicator').default, [{
- hostOrigin: '*',
- }])
- .after('htmlWebpackPlugin'); // 指定在 htmlWebpackPlugin 之后执行
- }
- }
- } satisfies UserConfigExport<'webpack5'>
|