Skip to content

Commit ceff8c3

Browse files
authored
fix: dynamic Mux import (#1758)
fix #1755
1 parent a4baf37 commit ceff8c3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"test": "tester test/*.js test/*/*.js --outdir=disttest --platform=node --format=esm --bundle --external:sinon --external:zora --target=esnext --sourcemap=inline",
1515
"test:coverage": "c8 --src src --exclude 'test/**' --exclude 'node_modules/**' --exclude 'scripts/**' --exclude-after-remap npm test",
1616
"test:codecov": "npm run test:coverage && c8 report --reporter json && codecov -f coverage/coverage-final.json",
17+
"build": "npm run build:lib && npm run build:lazy && npm run build:dist && npm run build:es6",
1718
"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",
1819
"build:lib": "builder src/*.js src/players/*.js --outdir=lib --format=cjs",
1920
"build:lazy": "builder src/*.js src/players/*.js --outdir=lazy --format=cjs",
@@ -22,7 +23,7 @@
2223
"build:es6": "builder src/standalone.js --outfile=dist/ReactPlayer.standalone.es6.js --format=esm --bundle --minify",
2324
"preversion": "npm run lint && npm run test",
2425
"version": "auto-changelog -p && npm run build:dist && npm run build:standalone && git add CHANGELOG.md dist",
25-
"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/* .",
26+
"prepublishOnly": "npm run build && node scripts/pre-publish.js && cp -r types/* .",
2627
"postpublish": "node scripts/post-publish.js && npm run clean"
2728
},
2829
"repository": {
@@ -69,7 +70,8 @@
6970
},
7071
"standard": {
7172
"ignore": [
72-
"/dist/*"
73+
"/dist/*",
74+
"/examples/*"
7375
]
7476
},
7577
"auto-changelog": {

src/players/Mux.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export default class Mux extends Component {
7676

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

0 commit comments

Comments
 (0)