Skip to content

Commit f8cdc9e

Browse files
committed
fix: workaround for vite hash issue (close #1008)
1 parent 8171f4d commit f8cdc9e

File tree

15 files changed

+117
-41
lines changed

15 files changed

+117
-41
lines changed

ecosystem/plugin-active-header-links/src/node/activeHeaderLinksPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ export const activeHeaderLinksPlugin = ({
5050

5151
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
5252

53+
alias: {
54+
// workaround for https://github.com/vitejs/vite/issues/7621
55+
'@vuepress/plugin-active-header-links/client': path.resolve(
56+
__dirname,
57+
'../client/index.js'
58+
),
59+
},
60+
5361
define: {
5462
__AHL_HEADER_LINK_SELECTOR__: headerLinkSelector,
5563
__AHL_HEADER_ANCHOR_SELECTOR__: headerAnchorSelector,

ecosystem/plugin-back-to-top/src/node/backToTopPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ export const backToTopPlugin = (): Plugin => ({
77
name: '@vuepress/plugin-back-to-top',
88

99
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
10+
11+
alias: {
12+
// workaround for https://github.com/vitejs/vite/issues/7621
13+
'@vuepress/plugin-back-to-top/client': path.resolve(
14+
__dirname,
15+
'../client/index.js'
16+
),
17+
},
1018
})

ecosystem/plugin-docsearch/src/node/docsearchPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ export const docsearchPlugin = (options: DocsearchPluginOptions): Plugin => ({
1111

1212
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
1313

14+
alias: {
15+
// workaround for https://github.com/vitejs/vite/issues/7621
16+
'@vuepress/plugin-docsearch/client': path.resolve(
17+
__dirname,
18+
'../client/index.js'
19+
),
20+
},
21+
1422
define: {
1523
__DOCSEARCH_OPTIONS__: options,
1624
},

ecosystem/plugin-external-link-icon/src/node/externalLinkIconPlugin.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ export const externalLinkIconPlugin = ({
2020
}: ExternalLinkIconPluginOptions = {}): Plugin => ({
2121
name: '@vuepress/plugin-external-link-icon',
2222

23+
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
24+
25+
alias: {
26+
// workaround for https://github.com/vitejs/vite/issues/7621
27+
'@vuepress/plugin-external-link-icon/client': path.resolve(
28+
__dirname,
29+
'../client/index.js'
30+
),
31+
},
32+
2333
define: {
2434
__EXTERNAL_LINK_ICON_LOCALES__: locales,
2535
},
2636

27-
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
28-
2937
extendsMarkdown: (md) => {
3038
let shouldRenderExternalIcon = false
3139

ecosystem/plugin-google-analytics/src/node/googleAnalyticsPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ export const googleAnalyticsPlugin =
3434

3535
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
3636

37+
alias: {
38+
// workaround for https://github.com/vitejs/vite/issues/7621
39+
'@vuepress/plugin-google-analytics/client': path.resolve(
40+
__dirname,
41+
'../client/index.js'
42+
),
43+
},
44+
3745
define: {
3846
__GA_ID__: id,
3947
},

ecosystem/plugin-medium-zoom/src/node/mediumZoomPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ export const mediumZoomPlugin = ({
3939

4040
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
4141

42+
alias: {
43+
// workaround for https://github.com/vitejs/vite/issues/7621
44+
'@vuepress/plugin-medium-zoom/client': path.resolve(
45+
__dirname,
46+
'../client/index.js'
47+
),
48+
},
49+
4250
define: {
4351
__MZ_SELECTOR__: selector,
4452
__MZ_ZOOM_OPTIONS__: zoomOptions,

ecosystem/plugin-nprogress/src/node/nprogressPlugin.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,14 @@ const __dirname = getDirname(import.meta.url)
55

66
export const nprogressPlugin = (): Plugin => ({
77
name: '@vuepress/plugin-nprogress',
8+
89
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
10+
11+
alias: {
12+
// workaround for https://github.com/vitejs/vite/issues/7621
13+
'@vuepress/plugin-nprogress/client': path.resolve(
14+
__dirname,
15+
'../client/index.js'
16+
),
17+
},
918
})

ecosystem/plugin-pwa-popup/src/node/pwaPopupPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export const pwaPopupPlugin =
3333

3434
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
3535

36+
alias: {
37+
// workaround for https://github.com/vitejs/vite/issues/7621
38+
'@vuepress/plugin-pwa-popup/client': path.resolve(
39+
__dirname,
40+
'../client/index.js'
41+
),
42+
},
43+
3644
define: {
3745
__PWA_POPUP_LOCALES__: locales,
3846
},

ecosystem/plugin-pwa/src/node/pwaPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ export const pwaPlugin =
3939

4040
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
4141

42+
alias: {
43+
// workaround for https://github.com/vitejs/vite/issues/7621
44+
'@vuepress/plugin-pwa/client': path.resolve(
45+
__dirname,
46+
'../client/index.js'
47+
),
48+
},
49+
4250
define: {
4351
__PWA_SW_FILENAME__: serviceWorkerFilename,
4452
},

ecosystem/plugin-search/src/node/searchPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ export const searchPlugin = ({
5858

5959
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
6060

61+
alias: {
62+
// workaround for https://github.com/vitejs/vite/issues/7621
63+
'@vuepress/plugin-search/client': path.resolve(
64+
__dirname,
65+
'../client/index.js'
66+
),
67+
},
68+
6169
define: {
6270
__SEARCH_LOCALES__: locales,
6371
__SEARCH_HOT_KEYS__: hotKeys,

0 commit comments

Comments
 (0)