-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02481fe
commit 092ef2b
Showing
1 changed file
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
import { makeRollupConfig } from "@jspsych/config/rollup"; | ||
import serve from 'rollup-plugin-serve'; | ||
import serve from "rollup-plugin-serve"; | ||
|
||
let rollupConfig = makeRollupConfig("lookitInitJsPsych"); | ||
|
||
const host = 'localhost'; | ||
const host = "localhost"; | ||
const port = 10001; // this needs to change for each package | ||
const content_dir = 'dist/'; | ||
const content_dir = "dist/"; | ||
|
||
rollupConfig.plugins = [ | ||
// options: https://github.com/thgh/rollup-plugin-serve/tree/master?tab=readme-ov-file#options | ||
serve({ | ||
contentBase: content_dir, | ||
historyApiFallback: true, | ||
host: host, | ||
port: port, | ||
onListening: function (server) { | ||
const address = server.address(); | ||
const host = (address.address === '::' || address.address === '::1') ? 'localhost' : address.address; | ||
const protocol = this.https ? 'https' : 'http'; | ||
console.log(`Server listening at ${protocol}://${host}:${address.port}/`); | ||
} | ||
}) | ||
// options: https://github.com/thgh/rollup-plugin-serve/tree/master?tab=readme-ov-file#options | ||
serve({ | ||
contentBase: content_dir, | ||
historyApiFallback: true, | ||
host: host, | ||
port: port, | ||
onListening: function (server) { | ||
const address = server.address(); | ||
const host = | ||
address.address === "::" || address.address === "::1" | ||
? "localhost" | ||
: address.address; | ||
const protocol = this.https ? "https" : "http"; | ||
console.log(`Server listening at ${protocol}://${host}:${address.port}/`); | ||
}, | ||
}), | ||
]; | ||
|
||
export default rollupConfig; |