forked from fluidd-core/fluidd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
84 lines (82 loc) · 2.18 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* eslint-disable @typescript-eslint/no-var-requires */
const MonacoEditorPlugin = require('monaco-editor-webpack-plugin')
const GenerateFilePlugin = require('generate-file-webpack-plugin')
const ThreadsPlugin = require('threads-plugin')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const v = require('./package.json').version
const h = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
module.exports = {
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enabbleInSFC: false
}
},
pwa: {
themeColor: '#2196F3',
msTileColor: '#000000',
appleMobileWebAppCache: 'yes',
manifestOptions: {
start_url: '/',
background_color: '#000000'
}
},
transpileDependencies: [
'vuetify'
],
configureWebpack: {
devtool: 'source-map',
resolve: {
symlinks: false // Don't follow symlinks, fixes issues when using npm link.
},
plugins: [
new MonacoEditorPlugin({
languages: ['markdown'],
features: ['!contextmenu', '!snippets', '!multicursor']
}),
new GenerateFilePlugin({
file: '.version',
content: 'v' + v + '\n'
}),
new ThreadsPlugin()
// new BundleAnalyzerPlugin({
// analyzerMode:
// (process.env.NODE_ENV === 'production') ? 'server' : 'disabled'
// })
]
},
chainWebpack: config => {
config.resolve.extensions
.add('.yml')
.add('yaml')
config.module
// Allows us to load yaml and have it loaded as json for locales.
.rule('yaml-loader')
.test(/.\.yaml$/)
.use('json-loader')
.loader('json-loader')
.end()
.use('yaml-loader')
.loader('yaml-loader')
.end()
config.module
// Loads the onigasm web assembly file directly
.rule('wasm-loader')
.test(/.\.wasm$/)
.type('javascript/auto')
.use('file-loader')
.loader('file-loader')
.end()
config
.plugin('define')
.tap(args => {
args[0]['process.env'].VERSION = JSON.stringify(v)
args[0]['process.env'].HASH = JSON.stringify(h)
return args
})
}
}