Skip to content

Commit

Permalink
fix: dynamic Mux import (#1758)
Browse files Browse the repository at this point in the history
fix #1755
  • Loading branch information
luwes committed Mar 2, 2024
1 parent a4baf37 commit ceff8c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test": "tester test/*.js test/*/*.js --outdir=disttest --platform=node --format=esm --bundle --external:sinon --external:zora --target=esnext --sourcemap=inline",
"test:coverage": "c8 --src src --exclude 'test/**' --exclude 'node_modules/**' --exclude 'scripts/**' --exclude-after-remap npm test",
"test:codecov": "npm run test:coverage && c8 report --reporter json && codecov -f coverage/coverage-final.json",
"build": "npm run build:lib && npm run build:lazy && npm run build:dist && npm run build:es6",
"build:demo": "cp -r examples/react/public demo && npm run build:lib && builder examples/react/src/index.js --format=iife --bundle --outdir=demo --minify --sourcemap",
"build:lib": "builder src/*.js src/players/*.js --outdir=lib --format=cjs",
"build:lazy": "builder src/*.js src/players/*.js --outdir=lazy --format=cjs",
Expand All @@ -22,7 +23,7 @@
"build:es6": "builder src/standalone.js --outfile=dist/ReactPlayer.standalone.es6.js --format=esm --bundle --minify",
"preversion": "npm run lint && npm run test",
"version": "auto-changelog -p && npm run build:dist && npm run build:standalone && git add CHANGELOG.md dist",
"prepublishOnly": "npm run build:lib && npm run build:lazy && npm run build:dist && npm run build:es6 && node scripts/pre-publish.js && cp -r types/* .",
"prepublishOnly": "npm run build && node scripts/pre-publish.js && cp -r types/* .",
"postpublish": "node scripts/post-publish.js && npm run clean"
},
"repository": {
Expand Down Expand Up @@ -69,7 +70,8 @@
},
"standard": {
"ignore": [
"/dist/*"
"/dist/*",
"/examples/*"
]
},
"auto-changelog": {
Expand Down
3 changes: 2 additions & 1 deletion src/players/Mux.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default class Mux extends Component {

if (!globalThis.customElements?.get('mux-player')) {
try {
await import(SDK_URL.replace('VERSION', config.version))
const sdkUrl = SDK_URL.replace('VERSION', config.version)
await import(/* webpackIgnore: true */ `${sdkUrl}`)
this.props.onLoaded()
} catch (error) {
onError(error)
Expand Down

0 comments on commit ceff8c3

Please sign in to comment.