mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Fix the issue with paths resolving incorrectly for the webpack config when running the master server with the --dev option from the project root folder through either npx clusteriomaster or node packages/master
32 lines
736 B
JavaScript
32 lines
736 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.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 },
|
|
"@clusterio/web_ui": { singleton: true },
|
|
"ajv": {},
|
|
"antd": { singleton: true },
|
|
"react": { singleton: true },
|
|
"react-dom": { singleton: true },
|
|
},
|
|
}),
|
|
],
|
|
});
|