diff --git a/lib/app/index.js b/lib/app/index.js index 4972dea315..64300af5ca 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('<%= 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)