Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adding RxPlayer to the global scope for bundles #1542

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@
"build:dev": "./scripts/generate_build.mjs --dev-mode",
"build:wasm:debug": "mkdir -p dist && cd ./src/parsers/manifest/dash/wasm-parser && cargo build --target wasm32-unknown-unknown && cp target/wasm32-unknown-unknown/debug/mpd_node_parser.wasm ../../../../../dist/mpd-parser.wasm",
"build:wasm:release": "./scripts/build_wasm_release.sh",
"bundle": "./scripts/run_bundler.mjs src/index.ts --production-mode -o dist/rx-player.js",
"bundle:min": "./scripts/run_bundler.mjs src/index.ts --production-mode -o dist/rx-player.min.js --minify",
"bundle:min:watch": "./scripts/run_bundler.mjs src/index.ts --production-mode -o dist/rx-player.min.js --minify --watch",
"bundle:watch": "./scripts/run_bundler.mjs src/index.ts --production-mode -o dist/rx-player.js --watch",
"bundle": "./scripts/run_bundler.mjs src/index.ts --production-mode --globals -o dist/rx-player.js",
"bundle:min": "./scripts/run_bundler.mjs src/index.ts --production-mode --globals -o dist/rx-player.min.js --minify",
"bundle:min:watch": "./scripts/run_bundler.mjs src/index.ts --production-mode --globals -o dist/rx-player.min.js --minify --watch",
"bundle:watch": "./scripts/run_bundler.mjs src/index.ts --production-mode --globals -o dist/rx-player.js --watch",
"certificate": "./scripts/generate_certificate",
"check": "npm run check:types && npm run lint && npm run check:types:unit_tests",
"check:all": "npm run check:types && npm run lint && npm run lint:demo && npm run lint:tests && npm run test:unit && npm run test:integration && npm run test:memory && node -r esm ./scripts/check_nodejs_import_compatibility.js",
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_bundler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ if (import.meta.url === pathToFileURL(process.argv[1]).href) {
const shouldWatch = args.includes("-w") || args.includes("--watch");
const shouldMinify = args.includes("-m") || args.includes("--minify");
const production = args.includes("-p") || args.includes("--production-mode");
const globalScope = args.includes("-g") || args.includes("--globals");
const silent = args.includes("-s") || args.includes("--silent");

let outfile;
Expand All @@ -66,6 +67,7 @@ if (import.meta.url === pathToFileURL(process.argv[1]).href) {
watch: shouldWatch,
minify: shouldMinify,
production,
globalScope,
silent,
outfile,
});
Expand Down Expand Up @@ -187,6 +189,7 @@ Available options:
-o <path>, --output <path> Specify an output file for the ES2017 bundle. To ignore to skip ES2017
bundle generation.
-p, --production-mode Build all files in production mode (less runtime checks, mostly).
-g, --globals Add the RxPlayer to the global scope.
-g, --global-scope If set, enable "global scope mode" (the \`__GLOBAL_SCOPE__\` global
symbol) on the bundle.
-s, --silent Don't log to stdout/stderr when bundling
Expand Down
Loading