-
-
Save DuncanFaulkner/2eb5abf6ea9c9a933f1bb39b95a7c509 to your computer and use it in GitHub Desktop.
ssr-4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dominoModule = require('domino'); | |
const fsModule = require('fs'); | |
const indexTemplate = fsModule.readFileSync('dist/browser/index.html').toString(); | |
const win = dominoModule.createWindow(indexTemplate); | |
(global as any).window = win; | |
(global as any).document = win.document; | |
(global as any).Event = win.Event; | |
(global as any).HTMLElement = win.HTMLElement; | |
(global as any).KeyboardEvent = win.KeyboardEvent; | |
(global as any).MouseEvent = win.MouseEvent; | |
(global as any).FocusEvent = win.FocusEvent; | |
(global as any).object = win.object; | |
(global as any).navigator = win.navigator; | |
(global as any).localStorage = win.localStorage; | |
(global as any).sessionStorage = win.sessionStorage; | |
(global as any).DOMTokenList = win.DOMTokenList; | |
// Can add other options as per your application configuration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment