From 8fc0395d611fcf7b5904bb04a360530b63903744 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 16 Nov 2023 21:53:54 +0100 Subject: fix(config): Adjust webpack config to provide `appName` and `appVersion` which are expected by `@nextcloud/vue` Signed-off-by: Ferdinand Thiessen --- webpack.common.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'webpack.common.js') 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', -- cgit v1.2.3