-
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.
fix build errors in GH actions by moving rollup-plugin-serve and watc…
…h into separate script (npm run dev)
- Loading branch information
1 parent
52ddf67
commit 02481fe
Showing
3 changed files
with
29 additions
and
25 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { makeRollupConfig } from "@jspsych/config/rollup"; | ||
import serve from 'rollup-plugin-serve'; | ||
|
||
let rollupConfig = makeRollupConfig("lookitInitJsPsych"); | ||
|
||
const host = 'localhost'; | ||
const port = 10001; // this needs to change for each package | ||
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}/`); | ||
} | ||
}) | ||
]; | ||
|
||
export default rollupConfig; |
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,3 @@ | ||
import { makeRollupConfig } from "@jspsych/config/rollup"; | ||
import serve from 'rollup-plugin-serve'; | ||
|
||
let rollupConfig = makeRollupConfig("lookitInitJsPsych"); | ||
|
||
const host = 'localhost'; | ||
const port = 10001; // this needs to change for each package | ||
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}/`); | ||
} | ||
}) | ||
]; | ||
|
||
export default rollupConfig; | ||
export default makeRollupConfig("lookitInitJsPsych"); |