@colyseus/monitor 0.16.1 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colyseus/monitor",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "description": "Web Monitoring Panel for Colyseus",
5
5
  "input": "./src/index.ts",
6
6
  "main": "./build/index.js",
@@ -1,10 +1,14 @@
1
1
  import express from 'express';
2
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
 
4
5
  import { getAPI } from './api.js';
5
6
  import './ext/Room.js';
6
7
 
7
- const frontendDirectory = path.resolve(__dirname, "..", "build", "static");
8
+ // __dirname is not available in ESM
9
+ // @ts-ignore
10
+ const getDirname = () => (typeof __dirname !== 'undefined') ? __dirname : path.dirname(fileURLToPath(import.meta.url));
11
+ const frontendDirectory = path.resolve(getDirname(), "..", "build", "static");
8
12
 
9
13
  export interface MonitorOptions {
10
14
  columns: Array<