mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 15:24:52 +09:00
Add hidden development option to run the webpack compiller for the given plugin(s) similar to the --dev option for the built-in web interface. This requires publicPath to be set in the webpack config and an updated version of webpack-dev-middleware to function correctly.
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
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.jsx",
|
|
devServer: {
|
|
contentBase: "./dist/web",
|
|
},
|
|
output: {
|
|
publicPath: "/",
|
|
filename: "bundle.js",
|
|
path: path.resolve(__dirname, "dist", "web"),
|
|
},
|
|
plugins: [
|
|
new webpack.container.ModuleFederationPlugin({
|
|
name: "master",
|
|
shared: {
|
|
"@clusterio/lib/config": { singleton: true },
|
|
"@clusterio/lib/errors": { singleton: true },
|
|
"@clusterio/lib/helpers": { singleton: true },
|
|
"@clusterio/lib/link": { singleton: true },
|
|
"@clusterio/lib/logging": { singleton: true },
|
|
"@clusterio/lib/plugin": { singleton: true },
|
|
"@clusterio/lib/schema": { singleton: true },
|
|
"@clusterio/lib/users": { singleton: true },
|
|
"@clusterio/web_ui": { singleton: true },
|
|
"ajv": {},
|
|
"antd": { singleton: true },
|
|
"react": { singleton: true },
|
|
"react-dom": { singleton: true },
|
|
},
|
|
}),
|
|
],
|
|
});
|