Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(config): Adjust webpack config to provide appName and `appVersi…
…on` which are expected by `@nextcloud/vue`

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Nov 20, 2023
commit 8fc0395d611fcf7b5904bb04a360530b63903744
7 changes: 7 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down