Skip to content

Commit

Permalink
Merge pull request #1542 from canalplus/fix/globalscope
Browse files Browse the repository at this point in the history
Fix adding RxPlayer to the global scope for bundles
  • Loading branch information
peaBerberian authored Sep 13, 2024
2 parents 2ca7291 + 71812c3 commit 00f96b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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

0 comments on commit 00f96b8

Please sign in to comment.