2022-01-27 19:26:42 +08:00
|
|
|
const isProd = process.env.NODE_ENV === `production`
|
|
|
|
|
2021-11-23 11:07:28 +08:00
|
|
|
module.exports = {
|
|
|
|
publicPath: process.env.SERVER_ENV === `NETLIFY` ? `/` : `/md/`, // 基本路径, 建议以绝对路径跟随访问目录
|
2021-11-24 13:35:35 +08:00
|
|
|
configureWebpack: (config) => {
|
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.(txt|md)$/i,
|
2022-02-28 19:09:39 +08:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: `raw-loader`,
|
|
|
|
},
|
|
|
|
],
|
2021-11-24 13:35:35 +08:00
|
|
|
})
|
|
|
|
},
|
2022-01-27 19:26:42 +08:00
|
|
|
productionSourceMap: !isProd,
|
2021-11-23 11:07:28 +08:00
|
|
|
css: {
|
2022-01-27 19:26:42 +08:00
|
|
|
sourceMap: !isProd,
|
2021-11-23 11:07:28 +08:00
|
|
|
},
|
|
|
|
}
|