mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
* .js to .ts * translate * update paths to dist/plugin * add "tsc --build" to prepare * use field main in package.json de find info * tsc --build need to append before webpack * update test and use for plugins package.main
29 lines
708 B
JavaScript
29 lines
708 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",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist", "web"),
|
|
},
|
|
plugins: [
|
|
new webpack.container.ModuleFederationPlugin({
|
|
name: "global_chat",
|
|
library: { type: "var", name: "plugin_global_chat" },
|
|
exposes: {
|
|
"./info": "./dist/plugin/info.js",
|
|
"./package.json": "./package.json",
|
|
},
|
|
shared: {
|
|
"@clusterio/lib": { import: false },
|
|
"@clusterio/web_ui": { import: false },
|
|
},
|
|
}),
|
|
],
|
|
});
|