-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
45 lines (43 loc) · 1.27 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { GenerateSW } = require('workbox-webpack-plugin');
const { TsconfigPathsPlugin } = require('tsconfig-paths-webpack-plugin');
module.exports = {
transpileDependencies: ['vuetify'],
// Fix Vuex-typescript in prod: https://github.com/istrib/vuex-typescript/issues/13#issuecomment-409869231
configureWebpack: (config) => {
config.plugins.push(new GenerateSW());
if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer[0].options.terserOptions = Object.assign(
{},
config.optimization.minimizer[0].options.terserOptions,
{
ecma: 5,
compress: {
keep_fnames: true,
},
warnings: false,
mangle: {
keep_fnames: true,
},
},
);
}
},
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => Object.assign(options, {
transformAssetUrls: {
'v-img': ['src', 'lazy-src'],
'v-card': 'src',
'v-card-media': 'src',
'v-responsive': 'src',
}
}));
config.resolve
.plugin('tsconfig-paths')
.use(TsconfigPathsPlugin);
},
}