forked from zengm-games/zengm
-
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
0e98fac
commit c11da9f
Showing
18 changed files
with
120 additions
and
115 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
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
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
import build from "./lib/build.js"; | ||
|
||
await build(); |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
import deploy from "./lib/deploy.mjs"; | ||
|
||
const sports = ["basketball", "football", "hockey"]; | ||
|
||
for (const sport of sports) { | ||
process.env.SPORT = sport; | ||
await deploy(); | ||
} |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
import deploy from "./lib/deploy.mjs"; | ||
|
||
await deploy(); |
This file was deleted.
Oops, something went wrong.
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,56 @@ | ||
import esbuild from "esbuild"; | ||
import alias from "esbuild-plugin-alias"; | ||
import path from "path"; | ||
import getSport from "./lib/getSport.js"; | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname); | ||
|
||
/** | ||
* Currently this is not used for anything. Eventually maybe it can replace the current rollup build script. Would need to do: | ||
* | ||
* - Figure out what to do with Karma and Jest | ||
* - Run pluginSportFunctions on both isSport and bySport | ||
* - Do something about extra rollup plugins (like blacklist) | ||
* - Compare bundle size (maybe still use terser) | ||
* - Figure out what targets to use for the prod/legacy builds, and confirm it all works | ||
* - Might not support all the features needed for legacy | ||
* - https://esbuild.github.io/content-types/#javascript | ||
* - https://github.com/evanw/esbuild/issues/297 | ||
* - Could still use babel on output | ||
*/ | ||
|
||
const sport = getSport(); | ||
|
||
const names = ["ui", "worker"]; | ||
await Promise.all( | ||
names.map(async name => { | ||
await esbuild.build({ | ||
entryPoints: [`src/${name}/index.${name === "ui" ? "tsx" : "ts"}`], | ||
bundle: true, | ||
sourcemap: true, | ||
inject: ["tools/lib/react-shim.js"], | ||
define: { | ||
"process.env.NODE_ENV": '"development"', | ||
"process.env.SPORT": JSON.stringify(sport), | ||
}, | ||
outfile: `build/gen/${name}.js`, | ||
plugins: [ | ||
// Not sure why this is required, docs say it should pick up on tsconfig.json settings | ||
alias({ | ||
"player-names": path.join( | ||
__dirname, | ||
"../src/worker/data/names-test.json", | ||
), | ||
"league-schema": path.join( | ||
__dirname, | ||
"../build/files/league-schema.json", | ||
), | ||
"bbgm-polyfills": path.join( | ||
__dirname, | ||
"../src/common/polyfills-noop.ts", | ||
), | ||
}), | ||
], | ||
}); | ||
}), | ||
); |
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
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