forked from doocs/md
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
35 lines (32 loc) · 841 Bytes
/
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
const isProd = process.env.NODE_ENV === `production`
const crypto = require(`crypto`)
/**
* md4 algorithm is not available anymore in NodeJS 17+ (because of lib SSL 3).
* In that case, silently replace md4 by md5 algorithm.
*/
try {
crypto.createHash(`md4`)
} catch (e) {
const origCreateHash = crypto.createHash
crypto.createHash = (alg, opts) => {
return origCreateHash(alg === `md4` ? `md5` : alg, opts)
}
}
module.exports = {
lintOnSave: true,
publicPath: process.env.SERVER_ENV === `NETLIFY` ? `/` : `/`, // 基本路径, 建议以绝对路径跟随访问目录
configureWebpack: (config) => {
config.module.rules.push({
test: /\.(txt|md)$/i,
use: [
{
loader: `raw-loader`,
},
],
})
},
productionSourceMap: !isProd,
css: {
sourceMap: !isProd,
},
}