Merge pull request #502 from sveltejs/gh-495

strip leading slash from basepath
This commit is contained in:
Rich Harris
2018-10-27 11:50:23 -04:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -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);

View File

@@ -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');