forked from ping-pub/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
85 lines (83 loc) · 2.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
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
85
const path = require('path')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
// const CompressionWebpackPlugin = require('compression-webpack-plugin')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
// const productionGzipExtensions = ['js', 'css']
module.exports = {
publicPath: '/',
productionSourceMap: false,
css: {
loaderOptions: {
sass: {
sassOptions: {
includePaths: ['./node_modules', './src/assets'],
},
},
},
},
configureWebpack: {
resolve: {
alias: {
'@themeConfig': path.resolve(__dirname, 'themeConfig.js'),
'@core': path.resolve(__dirname, 'src/@core'),
'@validations': path.resolve(__dirname, 'src/@core/utils/validations/validations.js'),
'@axios': path.resolve(__dirname, 'src/libs/axios'),
},
extensions: ['.json', '.js', '.jsx', '.ts', '.tsx'],
},
plugins: [
new NodePolyfillPlugin(),
new BundleAnalyzerPlugin({
analyzerMode: 'disabled',
openAnalyzer: false,
}),
// new CompressionWebpackPlugin({
// test: new RegExp(`\\.(${productionGzipExtensions.join('|')})$`),
// threshold: 8192,
// minRatio: 0.8,
// }),
],
},
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
// eslint-disable-next-line no-param-reassign
options.transformAssetUrls = {
img: 'src',
image: 'xlink:href',
'b-avatar': 'src',
'b-img': 'src',
'b-img-lazy': ['src', 'blank-src'],
'b-card': 'img-src',
'b-card-img': 'src',
'b-card-img-lazy': ['src', 'blank-src'],
'b-carousel-slide': 'img-src',
'b-embed': 'src',
}
return options
})
config.module
.rule('ts')
.test(/\.tsx?$/)
.use('ts-loader')
.loader('ts-loader')
.options({
appendTsSuffixTo: [/\.vue$/],
})
},
transpileDependencies: ['vue-echarts', 'resize-detector'],
devServer: {
proxy: {
'/api': {
target: 'https://cosmos.api.ping.pub/',
changeOrigin: true,
pathRewrite: {
'^/api': '',
},
},
},
},
}