Implement plugin loading in web interface

Add loading of plugin info to the web interface via webpack Module
Federation.
This commit is contained in:
Hornwitser committed 2020-10-27 18:24:45 +01:00
1 parent 542d8a798f
commit 6dbf29153e
25 files changed
+360 -102

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
"use strict";
const path = require("path");
const webpack = require("webpack");
const { merge } = require("webpack-merge");
const common = require("@clusterio/master/webpack.common");
module.exports = (env = {}) => merge(common(env), {
entry: "./web/index.jsx",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "static"),
},
plugins: [
new webpack.container.ModuleFederationPlugin({
name: "research_sync",
library: { type: "var", name: "plugin_research_sync" },
filename: "remoteEntry.js",
exposes: {
"./info": "./info.js",
},
shared: {
"@clusterio/lib": { import: false },
"ajv": { import: false },
},
}),
],
});