Skip to content

Commit

Permalink
fix: mark global/window/document as external globals (#7438)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored Sep 22, 2021
1 parent b83abd1 commit 029e92a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 11 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/**',
Expand Down Expand Up @@ -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) {
Expand All @@ -77,9 +83,6 @@ const progress = () => {

const globals = {
browser: {
'global': 'window',
'global/window': 'window',
'global/document': 'document'
},
module: {
},
Expand Down Expand Up @@ -132,6 +135,7 @@ export default cliargs => [
}),
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
Expand All @@ -156,6 +160,7 @@ export default cliargs => [
}),
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
Expand Down Expand Up @@ -242,6 +247,7 @@ export default cliargs => [
}),
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
Expand Down Expand Up @@ -288,6 +294,7 @@ export default cliargs => [
plugins: [
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
Expand All @@ -310,6 +317,7 @@ export default cliargs => [
primedIgnore,
primedResolve,
json(),
primedExternalGlobals,
primedCjs,
primedBabel,
cliargs.progress !== false ? progress() : {}
Expand Down

0 comments on commit 029e92a

Please sign in to comment.