From 9bd8d4a956d4e132de29f6dc76fb7a466d073bad Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Fri, 12 Dec 2025 10:08:12 +0100 Subject: [PATCH] fix(build): define vue compile time flags Signed-off-by: Grigorii K. Shartsev --- rspack.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rspack.config.js b/rspack.config.js index 2e6fc31b4f..ee3b898e39 100644 --- a/rspack.config.js +++ b/rspack.config.js @@ -197,6 +197,17 @@ module.exports = defineConfig((env) => { __IS_DESKTOP__: false, appName: JSON.stringify(appName), appVersion: JSON.stringify(appVersion), + // Vue compile time flags + // See: https://vuejs.org/api/compile-time-flags.html#compile-time-flags + // See: https://github.com/vuejs/core/blob/v3.5.24/packages/vue/README.md#bundler-build-feature-flags + // > The build will work without configuring these flags, + // > however it is strongly recommended to properly configure them in order to get proper tree-shaking in the final bundle + // Unlike Vite plugin, vue-loader does not do this automatically for Webpack + // Although documentation says, it is optional, sometimes it breaks with: + // ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined + __VUE_OPTIONS_API__: true, + __VUE_PROD_DEVTOOLS__: false, + __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, }), new CssExtractRspackPlugin({