2020-05-27 19:34:29 +00:00
|
|
|
const path = require('path');
|
2020-07-24 00:12:58 +00:00
|
|
|
const LCL = require('last-commit-log');
|
|
|
|
|
|
|
|
const lcl = new LCL();
|
2020-05-27 19:34:29 +00:00
|
|
|
|
2020-07-21 21:28:48 +00:00
|
|
|
const saveConfig = require('./config');
|
2020-05-28 08:26:36 +00:00
|
|
|
|
2020-07-21 21:28:48 +00:00
|
|
|
const config = saveConfig('public/config.json');
|
|
|
|
console.log(config);
|
2020-05-28 08:26:36 +00:00
|
|
|
|
2020-06-10 05:14:51 +00:00
|
|
|
process.env.VUE_APP_VERSION = require('./package.json').version;
|
|
|
|
|
2020-06-11 02:42:38 +00:00
|
|
|
try {
|
2020-07-24 00:12:58 +00:00
|
|
|
const lastCommit = lcl.getLastCommitSync();
|
2020-07-24 21:25:45 +00:00
|
|
|
process.env.VUE_APP_GIT_HASH = lastCommit.shortHash;
|
|
|
|
process.env.VUE_APP_GIT_DATE = lastCommit.committer.date;
|
|
|
|
process.env.VUE_APP_GIT_BRANCH = lastCommit.gitBranch;
|
2020-06-11 02:42:38 +00:00
|
|
|
} catch (e) {
|
|
|
|
// Sometimes on CI stuff they build with .git being present
|
2020-07-21 02:27:43 +00:00
|
|
|
// TODO: find better way to do this
|
2020-07-24 21:25:45 +00:00
|
|
|
process.env.VUE_APP_GIT_DATE = Math.floor(Date.now() / 1000);
|
|
|
|
process.env.VUE_APP_GIT_HASH = process.env.REVISION;
|
|
|
|
process.env.VUE_APP_GIT_BRANCH = process.env.SOURCE_BRANCH;
|
2020-06-11 02:42:38 +00:00
|
|
|
}
|
|
|
|
|
2020-05-25 22:12:22 +00:00
|
|
|
module.exports = {
|
2020-05-27 19:34:29 +00:00
|
|
|
lintOnSave: process.env.NODE_ENV !== 'production',
|
|
|
|
productionSourceMap: false,
|
2020-05-27 18:41:08 +00:00
|
|
|
transpileDependencies: ['vuetify'],
|
2020-05-26 00:33:24 +00:00
|
|
|
configureWebpack: {
|
2020-05-27 19:34:29 +00:00
|
|
|
devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-eval-source-map',
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
// Alias @ to /src folder for ES/TS imports
|
|
|
|
'@': path.join(__dirname, '/src'),
|
|
|
|
},
|
|
|
|
},
|
2020-06-07 05:22:11 +00:00
|
|
|
node: false,
|
2020-05-27 18:41:08 +00:00
|
|
|
},
|
2020-06-08 04:58:10 +00:00
|
|
|
|
2020-06-10 06:09:42 +00:00
|
|
|
// pluginOptions: {
|
|
|
|
// webpackBundleAnalyzer: {
|
|
|
|
// openAnalyzer: false,
|
2020-07-23 23:40:45 +00:00
|
|
|
// analyzerMode: process.env.VUE_CLI_MODERN_MODE ? 'server' : 'disabled',
|
2020-06-10 06:09:42 +00:00
|
|
|
// },
|
|
|
|
// },
|
2020-06-08 04:58:10 +00:00
|
|
|
|
2020-07-24 20:08:33 +00:00
|
|
|
// devServer: {
|
|
|
|
// disableHostCheck: true,
|
|
|
|
// },
|
|
|
|
|
2020-06-08 04:59:42 +00:00
|
|
|
css: {
|
|
|
|
extract: process.env.NODE_ENV === 'production' ? {
|
|
|
|
ignoreOrder: true,
|
|
|
|
} : false,
|
|
|
|
},
|
2020-05-25 22:12:22 +00:00
|
|
|
};
|