diff --git a/lib/app/index.js b/lib/app/index.js index 64300af5ca..568941ed59 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -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 %> <% }}) %> diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 10ee9f8736..ebdb2f66e4 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -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) } }