File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
const { config } = require ( "vuepress-theme-hope" ) ;
2
2
3
3
module . exports = config ( {
4
+ port : "8080" ,
4
5
title : "JavaGuide" ,
5
6
description : "Java学习&&面试指南" ,
6
7
//指定 vuepress build 的输出目录
7
8
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
+ } ,
8
28
head : [
9
29
[
10
30
"script" ,
You can’t perform that action at this time.
0 commit comments