Skip to content

Commit

Permalink
Use globalThis instead of global dependency (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS authored May 18, 2022
1 parent 9906d44 commit f3e50ed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/builder-vite/codegen-set-addon-channel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export function generateAddonSetupCode() {
return `
import global from 'global';
import createPostMessageChannel from '@storybook/channel-postmessage';
import createWebSocketChannel from '@storybook/channel-websocket';
import { addons } from '@storybook/addons';
Expand All @@ -9,7 +8,7 @@ export function generateAddonSetupCode() {
addons.setChannel(channel);
window.__STORYBOOK_ADDONS_CHANNEL__ = channel;
const { SERVER_CHANNEL_URL } = global;
const { SERVER_CHANNEL_URL } = globalThis;
if (SERVER_CHANNEL_URL) {
const serverChannel = createWebSocketChannel({ url: SERVER_CHANNEL_URL });
addons.setServerChannel(serverChannel);
Expand Down

0 comments on commit f3e50ed

Please sign in to comment.