|
|
@@ -38,25 +38,25 @@ class BuildTimerPlugin {
|
|
|
const duration = Date.now() - this.buildStartTime;
|
|
|
const seconds = (duration / 1000).toFixed(2);
|
|
|
const time = new Date().toLocaleTimeString('zh-CN', { hour12: false });
|
|
|
-
|
|
|
+
|
|
|
// 获取编译的模块数量
|
|
|
const modulesCount = stats.compilation.modules.size;
|
|
|
-
|
|
|
+
|
|
|
// 判断是否有错误或警告
|
|
|
const hasErrors = stats.hasErrors();
|
|
|
const hasWarnings = stats.hasWarnings();
|
|
|
-
|
|
|
+
|
|
|
console.log(`${hasErrors ? '❌' : '✅'} [构建 #${this.buildNumber}] 编译${hasErrors ? '失败' : '完成'}! ${time}`);
|
|
|
console.log(`⏱️ 耗时: ${seconds}s (${duration}ms)`);
|
|
|
console.log(`📊 模块数: ${modulesCount}`);
|
|
|
-
|
|
|
+
|
|
|
if (hasErrors) {
|
|
|
console.log(`⚠️ 错误: ${stats.compilation.errors.length} 个`);
|
|
|
}
|
|
|
if (hasWarnings) {
|
|
|
console.log(`⚠️ 警告: ${stats.compilation.warnings.length} 个`);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
|
});
|
|
|
}
|
|
|
@@ -68,7 +68,8 @@ export default {
|
|
|
stats: true,
|
|
|
},
|
|
|
defineConstants: {
|
|
|
- MQTT_BROKER_URL_FROM_WEBPACK: '"ws://192.168.110.13:8083/mqtt"',
|
|
|
+ // MQTT_BROKER_URL_FROM_WEBPACK: '"ws://192.168.110.13:8083/mqtt"',
|
|
|
+ MQTT_BROKER_URL_FROM_WEBPACK: '"ws://192.168.110.245:8083/mqtt"',
|
|
|
},
|
|
|
mini: {},
|
|
|
h5: {
|
|
|
@@ -80,14 +81,16 @@ export default {
|
|
|
devServer: {
|
|
|
proxy: {
|
|
|
'/dr': {
|
|
|
- target: 'http://192.168.110.245:6001', // 你的后端服务地址
|
|
|
+ // target: 'http://192.168.110.13:6001', // 你的后端服务地址
|
|
|
+ target: 'http://192.168.110.245:6001',
|
|
|
changeOrigin: true, // 允许跨域
|
|
|
// pathRewrite: {
|
|
|
// '^/dr/api': '' // 可选,用于重写路径
|
|
|
// }
|
|
|
},
|
|
|
'/mqtt': {
|
|
|
- target: 'ws://192.168.110.245:8083', // MQTT WebSocket 服务地址
|
|
|
+ // target: 'ws://192.168.110.13:8083', // MQTT WebSocket 服务地址
|
|
|
+ target: 'ws://192.168.110.245:8083',
|
|
|
changeOrigin: true,
|
|
|
ws: true, // 启用 WebSocket 代理
|
|
|
// pathRewrite: {
|
|
|
@@ -126,8 +129,8 @@ export default {
|
|
|
chain.plugin('define').use(webpack.DefinePlugin, [{}]);
|
|
|
}
|
|
|
/* 1. 把 Taro 可能注入的所有 react-refresh 插件先删掉 */
|
|
|
- chain.plugins.delete('react-refresh') // 3.5 之前
|
|
|
- chain.plugins.delete('ReactRefreshWebpackPlugin') // 3.6+ 可能叫这个
|
|
|
+ chain.plugins.delete('react-refresh'); // 3.5 之前
|
|
|
+ chain.plugins.delete('ReactRefreshWebpackPlugin'); // 3.6+ 可能叫这个
|
|
|
/* 2. 重新注册,强制关闭 overlay */
|
|
|
chain
|
|
|
.plugin('ReactRefreshWebpackPlugin') // 名字随意,保证唯一
|