-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: put sources under a single TypeScript config
Internal imports should be resolve relatively (i.e. player should not import from the package itself). The simplest way is to further group all sources, and use a single TypeScript configuration. With code-splitting enabled, the result is essentially the same.
- Loading branch information
Showing
157 changed files
with
455 additions
and
581 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
|
||
import { buildSync } from 'esbuild' | ||
|
||
// The ES module with only sources bundled (all other packages external). | ||
buildSync({ | ||
platform: 'browser', | ||
entryPoints: [ | ||
'src/streams/index.ts', | ||
'src/player/index.ts', | ||
'src/overlay/index.ts', | ||
], | ||
outdir: 'dist', | ||
format: 'esm', | ||
packages: 'external', | ||
bundle: true, | ||
minify: true, | ||
sourcemap: true, | ||
splitting: true, | ||
target: 'es2020', | ||
}) | ||
|
||
// A minified bundle that can be used as-is in browser with e.g. | ||
// <script type="module" src="/msl-streams.min.js"></script> | ||
for (const bundle of [ | ||
{ entry: 'src/streams/index.ts', name: 'msl-streams.min.js' }, | ||
{ entry: 'src/player/index.ts', name: 'msl-player.min.js' }, | ||
{ entry: 'src/overlay/index.ts', name: 'msl-overlay.min.js' }, | ||
]) { | ||
buildSync({ | ||
platform: 'browser', | ||
entryPoints: [bundle.entry], | ||
outfile: bundle.name, | ||
format: 'esm', | ||
bundle: true, | ||
minify: true, | ||
sourcemap: true, | ||
splitting: false, | ||
target: 'es2020', | ||
}) | ||
} |
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
Oops, something went wrong.