forked from gradido/gradido
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
68 lines (67 loc) · 2.15 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 webpack = require('webpack')
const Dotenv = require('dotenv-webpack')
const StatsPlugin = require('stats-webpack-plugin')
const HtmlWebpackPlugin = require('vue-html-webpack-plugin')
const CONFIG = require('./src/config')
// vue.config.js
module.exports = {
devServer: {
port: CONFIG.PORT,
},
pluginOptions: {
i18n: {
locale: 'de',
fallbackLocale: 'de',
localeDir: 'locales',
enableInSFC: false,
enableLegacy: false,
},
},
lintOnSave: true,
publicPath: '/',
configureWebpack: {
// Set up all the aliases we use in our app.
resolve: {
alias: {
assets: path.join(__dirname, 'src/assets'),
},
},
plugins: [
// .env and Environment Variables
new Dotenv(),
new webpack.DefinePlugin({
// Those are Environment Variables transmitted via Docker and are only available when defined here aswell
// 'process.env.DOCKER_WORKDIR': JSON.stringify(process.env.DOCKER_WORKDIR),
// 'process.env.BUILD_DATE': JSON.stringify(process.env.BUILD_DATE),
// 'process.env.BUILD_VERSION': JSON.stringify(process.env.BUILD_VERSION),
'process.env.BUILD_COMMIT': JSON.stringify(CONFIG.BUILD_COMMIT),
// 'process.env.PORT': JSON.stringify(process.env.PORT),
}),
// generate webpack stats to allow analysis of the bundlesize
new StatsPlugin('webpack.stats.json'),
new HtmlWebpackPlugin({
vue: true,
template: 'public/index.html',
meta: {
title_de: CONFIG.META_TITLE_DE,
title_en: CONFIG.META_TITLE_EN,
description_de: CONFIG.META_DESCRIPTION_DE,
description_en: CONFIG.META_DESCRIPTION_EN,
keywords_de: CONFIG.META_KEYWORDS_DE,
keywords_en: CONFIG.META_KEYWORDS_EN,
author: CONFIG.META_AUTHOR,
url: CONFIG.META_URL,
},
}),
],
infrastructureLogging: {
level: 'warn', // 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose'
},
},
css: {
// Enable CSS source maps.
sourceMap: CONFIG.NODE_ENV !== 'production',
},
outputDir: path.resolve(__dirname, './build'),
}