实用指南:VUE_PROD_HYDRATION_MISMATCH_DETAILS报了警告

问题

warning
main.ts:11
Feature flag VUE_PROD_HYDRATION_MISMATCH_DETAILS is not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
For more details, see
https://link.vuejs.org/feature-flags. 报了警告

解决办法

// vite.config.ts
import { defineConfig
} from 'vite';
export default defineConfig({
define: {
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
},
// ...其他配置
});
posted @ 2025-08-21 17:27  yjbjingcha  阅读(74)  评论(0)    收藏  举报