Mock window object for ES2020 module, Angular server build

44 views Asked by At

I mock window object using global variable like this global["window"]={location:{}};

It works in CommonJS module type. but not when using module type es2020. but I have specific need for es2020.

I went through multiple documentation to figure it out. But no luck. I am getting window reference error.

A solution to mock window object in Angular SSR build with es2020 module type.

0

There are 0 answers