Commit 592918a 1 parent 49c5983 commit 592918a Copy full SHA for 592918a
File tree 2 files changed +6
-8
lines changed
packages/@vuepress/core/lib/internal-plugins
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,13 @@ module.exports = (options, ctx) => ({
22
22
23
23
const themePalette = path . resolve ( ctx . themePath , 'styles/palette.styl' )
24
24
const userPalette = path . resolve ( sourceDir , '.vuepress/styles/palette.styl' )
25
- . replace ( / [ \\ ] + / g, '/' )
26
25
27
26
const themePaletteContent = fs . existsSync ( themePalette )
28
- ? `@import(${ JSON . stringify ( themePalette ) } )`
27
+ ? `@import(${ JSON . stringify ( themePalette . replace ( / [ \\ ] + / g , '/' ) ) } )`
29
28
: ''
30
29
31
30
const userPaletteContent = fs . existsSync ( userPalette )
32
- ? `@import(${ JSON . stringify ( userPalette ) } )`
31
+ ? `@import(${ JSON . stringify ( userPalette . replace ( / [ \\ ] + / g , '/' ) ) } )`
33
32
: ''
34
33
35
34
// user's palette can override theme's palette.
@@ -38,7 +37,7 @@ module.exports = (options, ctx) => ({
38
37
if ( ctx . parentThemePath ) {
39
38
const parentThemePalette = path . resolve ( ctx . parentThemePath , 'styles/palette.styl' )
40
39
const parentThemePaletteContent = fs . existsSync ( parentThemePalette )
41
- ? `@import(${ JSON . stringify ( parentThemePalette ) } )`
40
+ ? `@import(${ JSON . stringify ( parentThemePalette . replace ( / [ \\ ] + / g , '/' ) ) } )`
42
41
: ''
43
42
paletteContent = parentThemePaletteContent + paletteContent
44
43
}
Original file line number Diff line number Diff line change @@ -17,22 +17,21 @@ module.exports = (options, ctx) => ({
17
17
18
18
const themeStyle = path . resolve ( ctx . themePath , 'styles/index.styl' )
19
19
const userStyle = path . resolve ( sourceDir , '.vuepress/styles/index.styl' )
20
- . replace ( / [ \\ ] + / g, '/' )
21
20
22
21
const themeStyleContent = fs . existsSync ( themeStyle )
23
- ? `@import(${ JSON . stringify ( themeStyle ) } )`
22
+ ? `@import(${ JSON . stringify ( themeStyle . replace ( / [ \\ ] + / g , '/' ) ) } )`
24
23
: ''
25
24
26
25
const userStyleContent = fs . existsSync ( userStyle )
27
- ? `@import(${ JSON . stringify ( userStyle ) } )`
26
+ ? `@import(${ JSON . stringify ( userStyle . replace ( / [ \\ ] + / g , '/' ) ) } )`
28
27
: ''
29
28
30
29
let styleContent = themeStyleContent + userStyleContent
31
30
32
31
if ( ctx . parentThemePath ) {
33
32
const parentThemeStyle = path . resolve ( ctx . parentThemePath , 'styles/index.styl' )
34
33
const parentThemeStyleContent = fs . existsSync ( parentThemeStyle )
35
- ? `@import(${ JSON . stringify ( parentThemeStyle ) } )`
34
+ ? `@import(${ JSON . stringify ( parentThemeStyle . replace ( / [ \\ ] + / g , '/' ) ) } )`
36
35
: ''
37
36
styleContent = parentThemeStyleContent + styleContent
38
37
}
You can’t perform that action at this time.
0 commit comments