1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-25 02:42:10 +02:00

fix: mark global/window/document as external globals (#7438)

built off of the work in https://github.com/videojs/videojs-generate-rollup-config/pull/40
This commit is contained in:
Gary Katsevman 2021-09-22 12:55:17 -04:00 committed by GitHub
parent b83abd13fa
commit 029e92ac96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 3 deletions

39
package-lock.json generated
View File

@ -7550,6 +7550,15 @@
"integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=",
"dev": true
},
"is-reference": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
"dev": true,
"requires": {
"@types/estree": "*"
}
},
"is-regex": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
@ -11961,6 +11970,36 @@
"rollup-pluginutils": "^2.6.0"
}
},
"rollup-plugin-external-globals": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-external-globals/-/rollup-plugin-external-globals-0.6.1.tgz",
"integrity": "sha512-mlp3KNa5sE4Sp9UUR2rjBrxjG79OyZAh/QC18RHIjM+iYkbBwNXSo8DHRMZWtzJTrH8GxQ+SJvCTN3i14uMXIA==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^4.0.0",
"estree-walker": "^2.0.1",
"is-reference": "^1.2.1",
"magic-string": "^0.25.7"
},
"dependencies": {
"@rollup/pluginutils": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz",
"integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==",
"dev": true,
"requires": {
"estree-walker": "^2.0.1",
"picomatch": "^2.2.2"
}
},
"estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true
}
}
},
"rollup-plugin-ignore": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/rollup-plugin-ignore/-/rollup-plugin-ignore-1.0.9.tgz",

View File

@ -142,6 +142,7 @@
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-external-globals": "^0.6.1",
"rollup-plugin-ignore": "^1.0.5",
"rollup-plugin-istanbul": "^3.0.0",
"rollup-plugin-json": "^3.1.0",

View File

@ -14,6 +14,7 @@ import stub from 'rollup-plugin-stub';
import isCI from 'is-ci';
import replace from '@rollup/plugin-replace';
import istanbul from 'rollup-plugin-istanbul';
import externalGlobals from 'rollup-plugin-external-globals';
const excludeCoverage = [
'test/**',
@ -66,6 +67,11 @@ const primedBabel = babel({
['@babel/plugin-transform-runtime', {regenerator: false}]
]
});
const primedExternalGlobals = externalGlobals({
'global': 'window',
'global/window': 'window',
'global/document': 'document'
});
const progress = () => {
if (isCI) {
@ -77,9 +83,6 @@ const progress = () => {
const globals = {
browser: {
'global': 'window',
'global/window': 'window',
'global/document': 'document'
},
module: {
},
@ -132,6 +135,7 @@ export default cliargs => [
}),
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
@ -156,6 +160,7 @@ export default cliargs => [
}),
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
@ -242,6 +247,7 @@ export default cliargs => [
}),
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
@ -288,6 +294,7 @@ export default cliargs => [
plugins: [
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
@ -310,6 +317,7 @@ export default cliargs => [
primedIgnore,
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}