@@ -60,7 +60,10 @@ export default class TemplateRenderer {
6060// extra functionality with client manifest
6161if ( options . clientManifest ) {
6262const clientManifest = this . clientManifest = options . clientManifest
63- this . publicPath = clientManifest . publicPath
63+ // ensure publicPath ends with /
64+ this . publicPath = clientManifest . publicPath === ''
65+ ?''
66+ :clientManifest . publicPath . replace ( / ( [ ^ \/ ] ) $ / , '$1/' )
6467// preload/prefetch directives
6568this . preloadFiles = ( clientManifest . initial || [ ] ) . map ( normalizeFile )
6669this . prefetchFiles = ( clientManifest . async || [ ] ) . map ( normalizeFile )
@@ -114,7 +117,7 @@ export default class TemplateRenderer {
114117return (
115118// render links for css files
116119( cssFiles . length
117- ?cssFiles . map ( ( { file} ) => `<link rel="stylesheet" href="${ this . getPublicPath ( file ) } ">` ) . join ( '' )
120+ ?cssFiles . map ( ( { file} ) => `<link rel="stylesheet" href="${ this . publicPath } ${ file } ">` ) . join ( '' )
118121 :'' ) +
119122// context.styles is a getter exposed by vue-style-loader which contains
120123// the inline component styles collected during SSR
@@ -153,7 +156,7 @@ export default class TemplateRenderer {
153156extra = ` type="font/${ extension } " crossorigin`
154157}
155158return `<link rel="preload" href="${
156- this . getPublicPath ( file )
159+ this . publicPath } ${ file
157160} "${
158161asType !== '' ?` as="${ asType } "` :''
159162} ${
@@ -179,7 +182,7 @@ export default class TemplateRenderer {
179182if ( alreadyRendered ( file ) ) {
180183return ''
181184}
182- return `<link rel="prefetch" href="${ this . getPublicPath ( file ) } ">`
185+ return `<link rel="prefetch" href="${ this . publicPath } ${ file } ">`
183186} ) . join ( '' )
184187} else {
185188return ''
@@ -206,7 +209,7 @@ export default class TemplateRenderer {
206209const async = ( this . getUsedAsyncFiles ( context ) || [ ] ) . filter ( ( { file} ) => isJS ( file ) )
207210const needed = [ initial [ 0 ] ] . concat ( async || [ ] , initial . slice ( 1 ) )
208211return needed . map ( ( { file} ) => {
209- return `<script src="${ this . getPublicPath ( file ) } " defer></script>`
212+ return `<script src="${ this . publicPath } ${ file } " defer></script>`
210213} ) . join ( '' )
211214} else {
212215return ''
@@ -228,10 +231,6 @@ export default class TemplateRenderer {
228231}
229232return new TemplateStream ( this , this . parsedTemplate , context || { } )
230233}
231-
232- getPublicPath ( file :string ) {
233- return path . posix . join ( this . publicPath , file )
234- }
235234}
236235
237236function normalizeFile ( file :string ) :Resource {