mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[pixi][phaser][threejs] Fixed "ReferenceError: window is not defined" in Node.js environment. See #2409 (#2410)
This commit is contained in:
parent
1cc01d6c6b
commit
09bb49b5db
@ -30,7 +30,7 @@
|
||||
declare global {
|
||||
var require: any;
|
||||
}
|
||||
if (window.Phaser) {
|
||||
if (typeof window !== 'undefined' && window.Phaser) {
|
||||
let prevRequire = window.require;
|
||||
window.require = (x: string) => {
|
||||
if (prevRequire) return prevRequire(x);
|
||||
|
||||
@ -32,7 +32,7 @@ declare global {
|
||||
var PIXI: any;
|
||||
}
|
||||
|
||||
if (window.PIXI) {
|
||||
if (typeof window !== 'undefined' && window.PIXI) {
|
||||
let prevRequire = window.require;
|
||||
window.require = (x: string) => {
|
||||
if (prevRequire) return prevRequire(x);
|
||||
|
||||
@ -31,7 +31,7 @@ declare global {
|
||||
var require: any;
|
||||
}
|
||||
|
||||
if (window.THREE) {
|
||||
if (typeof window !== 'undefined' && window.THREE) {
|
||||
let prevRequire = window.require;
|
||||
window.require = (x: string) => {
|
||||
if (prevRequire) return prevRequire(x);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user