diff --git a/src/api/export.ts b/src/api/export.ts index e2f7f5d..482ba51 100644 --- a/src/api/export.ts +++ b/src/api/export.ts @@ -38,6 +38,8 @@ async function _export({ oninfo = noop, onfile = noop }: Opts = {}) { + basepath = basepath.replace(/^\//, '') + cwd = path.resolve(cwd); static_files = path.resolve(cwd, static_files); build_dir = path.resolve(cwd, build_dir); diff --git a/test/apps/with-basepath/test.ts b/test/apps/with-basepath/test.ts index f535b03..93bbcbf 100644 --- a/test/apps/with-basepath/test.ts +++ b/test/apps/with-basepath/test.ts @@ -17,7 +17,7 @@ describe('with-basepath', function() { await api.export({ cwd: __dirname, - basepath: 'custom-basepath' + basepath: '/custom-basepath' }); runner = new AppRunner(__dirname, '__sapper__/build/server/server.js');