mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Migrate the usage of CommonJS specific code and imports to ESM. Roughly summarised this: - Changes all require() calls to import statement or expressions. - Changes usage of module.exports to export statements. - Replaces require.resolve with import.meta.resolve. - Replaces conditional imports with conditional subpath imports. - Replaces module === require.main with import.meta.main. - Adds the full filename with extention to all relative imports. - Changes all usage of __dirname and __filename to their import.meta equivalents. - Sets "type": "module" in package.json files. - Removes usage of "use strict". - Adds .ts an an alias of .js for the webpack build. Due to differences in how require and import resolves files the plugin entrypoints will have to include the filename and extension after this migration in order to work.
18 lines
876 B
TypeScript
18 lines
876 B
TypeScript
import { bootstrap } from "./controller.js";
|
|
export { default as Controller } from "./src/Controller.js";
|
|
export { default as ControllerRouter } from "./src/ControllerRouter.js";
|
|
export { default as ControlConnection } from "./src/ControlConnection.js";
|
|
export { default as HostConnection } from "./src/HostConnection.js";
|
|
export { default as InstanceRecord } from "./src/InstanceRecord.js";
|
|
export { default as InstanceManager } from "./src/InstanceManager.js";
|
|
export { default as HostRecord } from "./src/HostRecord.js";
|
|
export { default as BaseControllerPlugin } from "./src/BaseControllerPlugin.js";
|
|
export { default as UserManager } from "./src/UserManager.js";
|
|
export { default as UserRecord } from "./src/UserRecord.js";
|
|
export { default as User } from "./src/User.js";
|
|
export { default as WsServer } from "./src/WsServer.js";
|
|
|
|
if (import.meta.main) {
|
|
bootstrap();
|
|
}
|