aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.common.js
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-11-16 21:53:54 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2023-11-20 17:07:55 +0100
commit8fc0395d611fcf7b5904bb04a360530b63903744 (patch)
tree62f4aab38c9cf80b35a11d3bd53c37cc6480daaa /webpack.common.js
parent22163c60d42bbd60181818d315442f98fbbe89d0 (diff)
downloadnextcloud-server-8fc0395d611fcf7b5904bb04a360530b63903744.tar.gz
nextcloud-server-8fc0395d611fcf7b5904bb04a360530b63903744.zip
fix(config): Adjust webpack config to provide `appName` and `appVersion` which are expected by `@nextcloud/vue`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'webpack.common.js')
-rw-r--r--webpack.common.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/webpack.common.js b/webpack.common.js
index 545a6d1b950..b1457d76efc 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -7,6 +7,9 @@ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const WorkboxPlugin = require('workbox-webpack-plugin')
const modules = require('./webpack.modules.js')
+const { readFileSync } = require('fs')
+
+const appVersion = readFileSync('./version.php').toString().match(/OC_VersionString[^']+'([^']+)/)?.[1] ?? 'unknown'
const formatOutputFromModules = (modules) => {
// merge all configs into one object, and use AppID to generate the fileNames
@@ -205,6 +208,10 @@ module.exports = {
},
}],
}),
+
+ // Make appName & appVersion available as a constants for '@nextcloud/vue' components
+ new webpack.DefinePlugin({ appName: JSON.stringify('Nextcloud') }),
+ new webpack.DefinePlugin({ appVersion: JSON.stringify(appVersion) }),
],
externals: {
OC: 'OC',