mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
Merge pull request #566 from nolanlawson/nolan/issue-565
fix: fix "sapper export" with a custom PORT
This commit is contained in:
@@ -55,7 +55,8 @@ async function _export({
|
||||
copy(path.join(build_dir, 'service-worker.js'), path.join(export_dir, 'service-worker.js'));
|
||||
copy(path.join(build_dir, 'service-worker.js.map'), path.join(export_dir, 'service-worker.js.map'));
|
||||
|
||||
const port = await ports.find(3000);
|
||||
const defaultPort = process.env.PORT ? parseInt(process.env.PORT) : 3000;
|
||||
const port = await ports.find(defaultPort);
|
||||
|
||||
const protocol = 'http:';
|
||||
const host = `localhost:${port}`;
|
||||
@@ -196,4 +197,4 @@ async function _export({
|
||||
function get_href(attrs: string) {
|
||||
const match = /href\s*=\s*(?:"(.*?)"|'(.+?)'|([^\s>]+))/.exec(attrs);
|
||||
return match[1] || match[2] || match[3];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user