-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.js
More file actions
33 lines (30 loc) · 1.05 KB
/
webpack.js
File metadata and controls
33 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* eslint no-useless-escape: 0 */
const WebpackShellPluginNext = require('webpack-shell-plugin-next')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const path = require('path')
webpackConfig.plugins.push(
new WebpackShellPluginNext({
onBuildStart: {
scripts: [
// eslint-disable-next-line no-multi-str, no-template-curly-in-string
'VERSION="${GITHUB_REF##*/}";\
if [ -n "${VERSION}" ];\
then\
echo "Github ref exists -> updating App version number to: "${VERSION}"";\
NEW_INFO=$(sed -E "s/<version>[0-9]{1,3}\.[0-9]{1,3}(\.[0-9]{1,3})?(-(alpha|beta|RC|dev)[0-9]*)?<\\/version>/<version>${VERSION}<\\/version>/g" appinfo/info.xml);\
echo "$NEW_INFO" > appinfo/info.xml;\
cat appinfo/info.xml;\
else\
echo "No Github ref -> using HEAD version";\
fi',
],
blocking: true,
parallel: false,
},
}),
)
webpackConfig.entry = {
main: path.resolve(path.join('src', 'main.js')),
switchboardpopuplocal: path.resolve(path.join('src', 'lib/switchboardpopuplocal.js')),
}
module.exports = webpackConfig