Skip to content

Commit

Permalink
Use global env.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed Jul 15, 2023
1 parent 6bfb7c0 commit 4312b09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions code/frameworks/ember/src/client/preview/globals.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { global } from '@storybook/global';

const { window: globalWindow } = global;

globalWindow.STORYBOOK_NAME = process.env.STORYBOOK_NAME;
globalWindow.STORYBOOK_ENV = 'ember';
global.STORYBOOK_NAME = process.env.STORYBOOK_NAME;
global.STORYBOOK_ENV = 'ember';
6 changes: 3 additions & 3 deletions code/frameworks/ember/src/client/preview/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { dedent } from 'ts-dedent';
import type { RenderContext } from '@storybook/types';
import type { OptionsArgs, EmberRenderer } from './types';

const { window: globalWindow, document } = global;
const { document } = global;

declare let Ember: any;

const rootEl = document.getElementById('storybook-root');

function loadEmberApp() {
const config = globalWindow.require(`${global.STORYBOOK_NAME}/config/environment`);
return globalWindow.require(`${global.STORYBOOK_NAME}/app`).default.create({
const config = global.require(`${global.STORYBOOK_NAME}/config/environment`);
return global.require(`${global.STORYBOOK_NAME}/app`).default.create({
autoboot: false,
rootElement: rootEl,
...config.APP,
Expand Down

0 comments on commit 4312b09

Please sign in to comment.