-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
vue.config.cjs
54 lines (53 loc) · 1.29 KB
/
vue.config.cjs
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
const webpack = require('webpack')
const CopyPlugin = require('copy-webpack-plugin')
const GitRevisionPlugin = require('git-revision-webpack-plugin')
const gitRevisionPlugin = new GitRevisionPlugin()
module.exports = {
css: {
sourceMap: true
},
lintOnSave: false,
pwa: {
iconPaths: {
favicon32: null,
favicon16: null,
faviconSVG: 'favicon.svg',
appleTouchIcon: 'favicon.svg',
maskIcon: 'favicon.svg',
},
themeColor: '#afd4e3',
name: 'VTBs in bilibili!',
appleMobileWebAppCapable: 'yes',
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: './src/service-worker.js',
},
},
chainWebpack: config => {
config.module.rule('js').exclude.add(/\.worker\.js$/)
},
configureWebpack: {
devtool: 'source-map',
module: {
rules: [
{
test: /\.worker\.js$/,
use: {
loader: 'worker-loader',
options: { inline: true },
},
},
],
},
plugins: [
new webpack.ContextReplacementPlugin(
/moment[/\\]locale$/,
/zh-cn/,
),
new CopyPlugin([
{ from: 'BiliChat/docs', to: 'BiliChat' },
]),
new webpack.DefinePlugin({ COMMIT_HASH: JSON.stringify(gitRevisionPlugin.commithash()) }),
],
},
}