mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
In order to import a path inside packages/lib/ in the webpack shared
module environment it has to be declared as shared in both the web_ui
webpack config and the plugin's webpack config. This is rather error
prone and easy to miss. Move the burden of specifying which entrypoints
are valid in lib to lib itself by changing all imports in the web
interface code to import from @clusterio/lib instead sub paths.
For web code this means imports is done like this from now on:
import { libConfig, libLink } from "@clusterio/lib";
For info.js which has to be loadable by both Node.js and web code the
imports are done as follows:
const { libConfig, libLink } = require("@clusterio/lib");
While the Node.js only code can either continue to import sub paths
directly or use the info.js style.
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
"use strict";
|
|
const libBuildMod = require("./build_mod");
|
|
const libCommand = require("./command");
|
|
const libConfig = require("./config");
|
|
const libDatabase = require("./database");
|
|
const libErrors = require("./errors");
|
|
const libFactorio = require("./factorio");
|
|
const libFileOps = require("./file_ops");
|
|
const libHash = require("./hash");
|
|
const libHelpers = require("./helpers");
|
|
const libLink = require("./link");
|
|
const libLogging = require("./logging");
|
|
const libLoggingUtils = require("./logging_utils");
|
|
const libLuaTools = require("./lua_tools");
|
|
const libPlugin = require("./plugin");
|
|
const libPluginLoader = require("./plugin_loader");
|
|
const libPrometheus = require("./prometheus");
|
|
const libSchema = require("./schema");
|
|
const libSharedCommands = require("./shared_commands");
|
|
const libUsers = require("./users");
|
|
|
|
const RateLimiter = require("./RateLimiter");
|
|
|
|
|
|
module.exports = {
|
|
libBuildMod,
|
|
libCommand,
|
|
libConfig,
|
|
libDatabase,
|
|
libErrors,
|
|
libFactorio,
|
|
libFileOps,
|
|
libHash,
|
|
libHelpers,
|
|
libLink,
|
|
libLogging,
|
|
libLoggingUtils,
|
|
libLuaTools,
|
|
libPlugin,
|
|
libPluginLoader,
|
|
libPrometheus,
|
|
libSchema,
|
|
libSharedCommands,
|
|
libUsers,
|
|
|
|
RateLimiter,
|
|
};
|