Skip to content

Commit

Permalink
(fix): prod builds with @angular/cli 6.0.0, global is not defined
Browse files Browse the repository at this point in the history
More info: [@angular/cli issue 9827](angular/angular-cli#9827 (comment))
  • Loading branch information
osnoser1 committed Apr 7, 2018
1 parent 8e964a7 commit 31b1a6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
declare let global: any;

const _global = typeof window === 'object' ? window : global;

/* tslint:disable:variable-name */
export const MouseEvent = (global as any).MouseEvent as MouseEvent;
export const KeyboardEvent = (global as any).KeyboardEvent as KeyboardEvent;
export const Event = (global as any).Event as Event;
export const MouseEvent = (_global as any).MouseEvent as MouseEvent;
export const KeyboardEvent = (_global as any).KeyboardEvent as KeyboardEvent;
export const Event = (_global as any).Event as Event;

0 comments on commit 31b1a6f

Please sign in to comment.