Skip to content

Commit

Permalink
Find an unused port to serve from
Browse files Browse the repository at this point in the history
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
  • Loading branch information
Richienb committed Dec 4, 2020
1 parent 8e1d31d commit b3b0d0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const ora = require("ora")
const path = require("path")
const updateNotifier = require("update-notifier")
const exitHook = require("exit-hook")
const getPort = require("get-port")
const pkg = require("./package.json")

const { babel } = require("@rollup/plugin-babel")
Expand Down Expand Up @@ -97,6 +98,7 @@ module.exports = (async () => {
open: true,
openPage: `?extension=${path.basename(outputFile)}`,
verbose: false,
port: await getPort({port: 8080}),
contentBase: [
path.dirname(outputFile),
path.dirname(require.resolve("scratch-gui/lib.min"))
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
"@rollup/plugin-typescript": "^5.0.2",
"chalk": "^4.1.0",
"exit-hook": "^2.2.0",
"get-port": "^5.1.1",
"meow": "^7.1.0",
"ora": "^5.0.0",
"path-exists": "^4.0.0",
"rollup": "^2.26.6",
"rollup-plugin-serve": "^1.0.4",
"rollup-plugin-serve": "^1.1.0",
"scratch-gui": "SheepTester/scratch-gui#ca7b69cbae7f37870f05d6ccc1d1d32584918980",
"update-notifier": "^4.1.1"
},
Expand Down

0 comments on commit b3b0d0f

Please sign in to comment.