From 6a562e1fe73e897a009b9b00cc3a19950892b382 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 21 Jun 2017 01:53:53 +0430 Subject: [PATCH] fix minor problems with relative --- lib/app/index.js | 2 +- lib/builder/builder.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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) } }