Skip to content

Commit 4c14eda

Browse files
committed
Update config.js
1 parent b52f304 commit 4c14eda

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/.vuepress/config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
const { config } = require("vuepress-theme-hope");
22

33
module.exports = config({
4+
port: "8080",
45
title: "JavaGuide",
56
description: "Java学习&&面试指南",
67
//指定 vuepress build 的输出目录
78
dest: "./dist",
9+
// 是否开启默认预加载js
10+
shouldPrefetch: (file, type) => false,
11+
// webpack 配置 https://vuepress.vuejs.org/zh/config/#chainwebpack
12+
chainWebpack: config => {
13+
if (process.env.NODE_ENV === 'production') {
14+
const dateTime = new Date().getTime();
15+
16+
// 清除js版本号
17+
config.output.filename('assets/js/jg-[name].js?v=' + dateTime).end();
18+
config.output.chunkFilename('assets/js/jg-[name].js?v=' + dateTime).end();
19+
20+
// 清除css版本号
21+
config.plugin('mini-css-extract-plugin').use(require('mini-css-extract-plugin'), [{
22+
filename: 'assets/css/[name].css?v=' + dateTime,
23+
chunkFilename: 'assets/css/[name].css?v=' + dateTime
24+
}]).end();
25+
26+
}
27+
},
828
head: [
929
[
1030
"script",

0 commit comments

Comments
 (0)