This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
68 lines (57 loc) · 1.59 KB
/
vue.config.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const path = require('path');
const LCL = require('last-commit-log');
const lcl = new LCL();
const config = require('./config');
const configFile = 'public/config.json';
const appConfig = config.get(configFile);
console.log(appConfig);
config.save(appConfig, configFile);
const pkgVersion = require('./package.json').version;
process.env.VUE_APP_VERSION = process.env.VERSION || pkgVersion;
try {
const lastCommit = lcl.getLastCommitSync();
process.env.VUE_APP_GIT_HASH = lastCommit.hash;
process.env.VUE_APP_GIT_DATE = lastCommit.committer.date;
} catch (e) {
// Sometimes on CI stuff they build with .git being present
// TODO: find better way to do this
process.env.VUE_APP_GIT_DATE = Math.floor(Date.now() / 1000);
process.env.VUE_APP_GIT_HASH = process.env.REVISION;
}
module.exports = {
// Relative publicPath to support subfolders
publicPath: '',
transpileDependencies: ['vuetify'],
integrity: true,
configureWebpack: {
resolve: {
alias: {
// Alias @ to /src folder for ES/TS imports
'@': path.join(__dirname, '/src'),
},
},
node: false,
},
pluginOptions: {
lintStyleOnBuild: true,
stylelint: {},
},
// devServer: {
// disableHostCheck: true,
// },
// https://github.com/vuejs/vue-cli/issues/3771
css: {
extract: process.env.NODE_ENV === 'production' ? {
ignoreOrder: true,
} : false,
},
chainWebpack: (conf) => {
conf
.plugin('html')
.tap((args) => {
// eslint-disable-next-line no-param-reassign
args[0].title = 'SyncLounge';
return args;
});
},
};