mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 15:04:52 +09:00
Add loading of plugin info to the web interface via webpack Module Federation.
30 lines
653 B
JavaScript
30 lines
653 B
JavaScript
"use strict";
|
|
const path = require("path");
|
|
const webpack = require("webpack");
|
|
const { merge } = require("webpack-merge");
|
|
|
|
const common = require("./webpack.common");
|
|
|
|
module.exports = (env = {}) => merge(common(env), {
|
|
entry: "./web/index.jsx",
|
|
devServer: {
|
|
contentBase: "./static",
|
|
},
|
|
output: {
|
|
filename: "bundle.js",
|
|
path: path.resolve(__dirname, "static"),
|
|
},
|
|
plugins: [
|
|
new webpack.container.ModuleFederationPlugin({
|
|
name: "master",
|
|
shared: {
|
|
"@clusterio/lib": { singleton: true },
|
|
"ajv": {},
|
|
"antd": { singleton: true },
|
|
"react": { singleton: true },
|
|
"react-dom": { singleton: true },
|
|
},
|
|
}),
|
|
],
|
|
});
|