Ver código fonte

fix(config): Adjust webpack config to provide `appName` and `appVersion` which are expected by `@nextcloud/vue`

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
tags/v28.0.0rc1
Ferdinand Thiessen 6 meses atrás
pai
commit
8fc0395d61
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7
    0
      webpack.common.js

+ 7
- 0
webpack.common.js Ver arquivo

@@ -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',

Carregando…
Cancelar
Salvar