Merge pull request #16540 from nextcloud/backport/16539/stable32

[stable32] fix(build): define vue compile time flags
This commit is contained in:
Joas Schilling 2025-12-12 10:55:19 +01:00 committed by GitHub
commit 1b9c22ba96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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({