mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Change the expected exported name of plugin declarations to be "plugin" at the main entrypoint instead of the default export. This makes the plugin's code organisation more flexible especially when using CommonJS JavaScript modules as they can export additional symbols from the plugin declaration file.
33 lines
834 B
JavaScript
33 lines
834 B
JavaScript
"use strict";
|
|
const path = require("path");
|
|
const webpack = require("webpack");
|
|
const { merge } = require("webpack-merge");
|
|
|
|
const common = require("@clusterio/web_ui/webpack.common");
|
|
|
|
module.exports = (env = {}) => merge(common(env), {
|
|
context: __dirname,
|
|
entry: "./web/index.tsx",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist", "web"),
|
|
},
|
|
plugins: [
|
|
new webpack.container.ModuleFederationPlugin({
|
|
name: "subspace_storage",
|
|
library: { type: "var", name: "plugin_subspace_storage" },
|
|
exposes: {
|
|
"./": "./index.ts",
|
|
"./package.json": "./package.json",
|
|
"./web": "./web/index.tsx",
|
|
},
|
|
shared: {
|
|
"@clusterio/lib": { import: false },
|
|
"@clusterio/web_ui": { import: false },
|
|
"antd": { import: false },
|
|
"react": { import: false },
|
|
"react-dom": { import: false },
|
|
},
|
|
}),
|
|
],
|
|
});
|