mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
5dec24f819
* fix: Update the command line parameter passing method * chore: Upgrade mockm * chore: Only use mockm with md-cli * chore: Update the version number of md-cli * feat: Optimize process management * fix: Optimize space paths
36 lines
844 B
JavaScript
36 lines
844 B
JavaScript
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` ? `/` : `/md/`, // 基本路径, 建议以绝对路径跟随访问目录
|
|
configureWebpack: (config) => {
|
|
config.module.rules.push({
|
|
test: /\.(txt|md)$/i,
|
|
use: [
|
|
{
|
|
loader: `raw-loader`,
|
|
},
|
|
],
|
|
})
|
|
},
|
|
productionSourceMap: !isProd,
|
|
css: {
|
|
sourceMap: !isProd,
|
|
},
|
|
}
|