@@ -93,9 +93,22 @@ module.exports = {
9393 additionalAliases : [ 'process' ] ,
9494 } ) ,
9595
96- // Make appName & appVersion available as a constant
97- new webpack . DefinePlugin ( { appName : JSON . stringify ( appName ) } ) ,
98- new webpack . DefinePlugin ( { appVersion : JSON . stringify ( appVersion ) } ) ,
96+ new webpack . DefinePlugin ( {
97+ // Make appName & appVersion available as a constant
98+ appName : JSON . stringify ( appName ) ,
99+ appVersion : JSON . stringify ( appVersion ) ,
100+ // Vue compile time flags
101+ // See: https://vuejs.org/api/compile-time-flags.html#compile-time-flags
102+ // See: https://github.com/vuejs/core/blob/v3.5.24/packages/vue/README.md#bundler-build-feature-flags
103+ // > The build will work without configuring these flags,
104+ // > however it is strongly recommended to properly configure them in order to get proper tree-shaking in the final bundle
105+ // Unlike Vite plugin, vue-loader does not do this automatically for Webpack
106+ // Although documentation says, it is optional, sometimes it breaks with:
107+ // ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined
108+ __VUE_OPTIONS_API__ : JSON . parse ( process . env . __VUE_OPTIONS_API__ ?? 'true' ) ,
109+ __VUE_PROD_DEVTOOLS__ : JSON . parse ( process . env . __VUE_PROD_DEVTOOLS__ ?? 'false' ) ,
110+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ : JSON . parse ( process . env . __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? 'false' ) ,
111+ } ) ,
99112
100113 // @nextcloud /moment since v1.3.0 uses `moment/min/moment-with-locales.js`
101114 // Which works only in Node.js and is not compatible with Webpack bundling
0 commit comments