File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,9 @@ export function resolveTemplateCompilerOptions(
108
108
// request
109
109
if ( filename . startsWith ( options . root ) ) {
110
110
assetUrlOptions = {
111
- base : '/' + slash ( path . relative ( options . root , path . dirname ( filename ) ) )
111
+ base :
112
+ options . devServer . config . base +
113
+ slash ( path . relative ( options . root , path . dirname ( filename ) ) )
112
114
}
113
115
}
114
116
} else {
Original file line number Diff line number Diff line change @@ -66,8 +66,9 @@ beforeAll(async () => {
66
66
if ( ! isBuildTest ) {
67
67
process . env . VITE_INLINE = 'inline-serve'
68
68
server = await ( await createServer ( options ) ) . listen ( )
69
- // use resolved port from server
70
- const url = ( ( global as any ) . viteTestUrl = `http://localhost:${ server . config . server . port } ` )
69
+ // use resolved port/base from server
70
+ const base = server . config . base === '/' ? '' : server . config . base
71
+ const url = ( ( global as any ) . viteTestUrl = `http://localhost:${ server . config . server . port } ${ base } ` )
71
72
await page . goto ( url )
72
73
} else {
73
74
process . env . VITE_INLINE = 'inline-build'
@@ -100,7 +101,7 @@ function startStaticServer(): Promise<string> {
100
101
try {
101
102
config = require ( configFile )
102
103
} catch ( e ) { }
103
- const base = config ?. build ?. base || ''
104
+ const base = ( config ?. base || '/' ) === '/' ? '' : config . base
104
105
105
106
// @ts -ignore
106
107
if ( config && config . __test__ ) {
You can’t perform that action at this time.
0 commit comments