fix minor problems with relative

This commit is contained in:
Pooya Parsa 2017-06-21 01:53:53 +04:30
parent 4cfe700846
commit 6a562e1fe7
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,7 @@ if (process.browser) {
// Import SSR plugins
<% plugins.forEach(function (plugin) { if (plugin.ssr)
{ %>let <%= plugin.name %> = require('<%= relative(r(plugin.src)) %>')
{ %>let <%= plugin.name %> = require('<%= relative(plugin.src) %>')
<%= plugin.name %> = <%= plugin.name %>.default || <%= plugin.name %>
<% }}) %>

View File

@ -413,7 +413,11 @@ export default class Builder extends Tapable {
if (dest && dest.includes('~')) {
return dest
}
return relative(this.options.buildDir, dest)
let rp = relative(this.options.buildDir, dest)
if (rp[0] !== '.') {
rp = './' + rp
}
return wp(rp)
}
}