Use relative path for plugins paths

This commit is contained in:
Sébastien Chopin 2017-06-20 20:31:03 +02:00
parent e1be5944cd
commit 4cfe700846

View File

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