-
Notifications
You must be signed in to change notification settings - Fork 443
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
a805cfa
commit cd5a15c
Showing
34 changed files
with
1,265 additions
and
381 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import type { OutputOptions, RollupOptions } from 'rollup'; | ||
import { | ||
BuildOptions, | ||
copyOutputToTests, | ||
fileSize, | ||
jsBannerPlugin, | ||
versionPlugin, | ||
watchDir, | ||
} from './utils'; | ||
import { join } from 'path'; | ||
import { minifyPlugin } from './minify'; | ||
|
||
export function buildMediaImplementation(opts: BuildOptions): RollupOptions { | ||
const debugOutput: OutputOptions = { | ||
file: join(opts.distLibDebugDir, `partytown-media.js`), | ||
format: 'es', | ||
exports: 'none', | ||
intro: `((self) => {`, | ||
outro: `})(self);`, | ||
plugins: [...minifyPlugin(opts, true), versionPlugin(opts), fileSize()], | ||
}; | ||
|
||
const output: OutputOptions[] = [debugOutput]; | ||
if (!opts.isDev) { | ||
output.push({ | ||
file: join(opts.distLibDir, `partytown-media.js`), | ||
format: 'es', | ||
exports: 'none', | ||
intro: `((self) => {`, | ||
outro: `})(self);`, | ||
plugins: [...minifyPlugin(opts, false), versionPlugin(opts), fileSize()], | ||
}); | ||
} | ||
|
||
return { | ||
input: join(opts.tscLibDir, 'web-worker', 'media', 'index.js'), | ||
output, | ||
plugins: [ | ||
watchDir(opts, join(opts.tscLibDir, 'web-worker', 'media')), | ||
jsBannerPlugin(opts), | ||
copyOutputToTests(opts), | ||
], | ||
}; | ||
} |
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
Oops, something went wrong.