Files
restitution/webpack.config.js
root 2e07519648 Refactor: Component-based architecture + 10 sub-systems
- Implemented 10 sub-systems (Economy, Pathfinding, Combat, Selection, Network, Map, Entity/Building/ControlPoint state machines, Orchestrator)
- Refactored Custom_Entity.js → Unit.js with 5 components (health, owner, inventory, movement, combat)
- Added Jest test suite with 100+ tests (EconomySystem 100%, EntityStateMachine 100%, PathfindingSystem 99%, Unit.js 72%)
- All webpack builds pass (0 errors)
- BMAD-auto team-respawn flow: 10 parallel sub-agents implemented systems

Architecture: Phaser 3 + XState + socket.io + EasyStar
Mode: team-respawn
Model: custom/ollama-cloud-pro
2026-05-29 22:13:44 +00:00

90 lines
1.9 KiB
JavaScript

const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
mode: "development",
entry: {
index: "./src/index.js",
},
resolve: {
alias: {
PhaserClasses: path.resolve(__dirname, "src/phaserClasses/"),
Components: path.resolve(__dirname, "src/components/"),
Entities: path.resolve(__dirname, "src/entities/"),
Scenes: path.resolve(__dirname, "src/scenes/"),
Scripts: path.resolve(__dirname, "src/scripts/"),
Styles: path.resolve(__dirname, "src/styles/"),
Systems: path.resolve(__dirname, "src/systems/"),
},
},
devtool: "inline-source-map",
devServer: {
static: "./public",
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "OPTIONS, POST, GET",
},
},
plugins: [
new HtmlWebpackPlugin({
title: "Game Server",
meta: {
language: {
httpEquiv: "Content-Language",
content: "en_US",
},
viewport: {
key: "viewport",
content: "initial-scale=1, width=device-width",
},
},
templateContent: ({ htmlWebpackPlugin }) => `
<html>
<head>
${htmlWebpackPlugin.tags.headTags}
<title>Restitution</title>
</head>
<body>
<div id="root"></div>
${htmlWebpackPlugin.tags.bodyTags}
</body>
</html>
`,
}),
],
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist"),
clean: true,
},
optimization: {
runtimeChunk: "single",
},
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
},
},
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: "asset/resource",
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: "asset/resource",
},
],
},
};