From 5461422397aa498697216f153bcdc5b3b9c35eae Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Thu, 29 Oct 2026 15:51:25 +0900 Subject: [PATCH] 1.0.7 RC2 --- index.ts | 1 - package.json | 8 ++++---- tsconfig.browser.json | 2 +- vite.config.js | 6 ++++++ web/index.tsx | 4 ---- webpack.config.cjs | 28 ---------------------------- 6 files changed, 11 insertions(+), 38 deletions(-) create mode 100644 vite.config.js delete mode 100644 web/index.tsx delete mode 100644 webpack.config.cjs diff --git a/index.ts b/index.ts index ce5aa4a..361cc4f 100644 --- a/index.ts +++ b/index.ts @@ -104,7 +104,6 @@ export const plugin: lib.PluginDeclaration = { name: 'chat_relay', title: 'Chat Relay', description: 'Bidirectional chat relay between Factorio and Discord.', - webEntrypoint: './web', instanceEntrypoint: 'dist/node/instance.js', controllerEntrypoint: 'dist/node/controller.js', controllerConfigFields: { diff --git a/package.json b/package.json index 92f2f88..6fe4883 100644 --- a/package.json +++ b/package.json @@ -22,18 +22,18 @@ ], "main": "dist/node/index.js", "scripts": { - "prepare": "tsc --build && webpack-cli --mode production", + "prepare": "tsc --build && vite build", "test": "echo \"Error: run tests from root\" && exit 1" }, "peerDependencies": { + "@clusterio/controller": "workspace:^", "@clusterio/lib": "workspace:^" }, "devDependencies": { + "@clusterio/controller": "workspace:^", "@clusterio/lib": "workspace:^", "@clusterio/web_ui": "workspace:^", - "webpack": "catalog:", - "webpack-cli": "catalog:", - "webpack-merge": "catalog:" + "vite": "catalog:" }, "dependencies": { "discord.js": "^14.27.0", diff --git a/tsconfig.browser.json b/tsconfig.browser.json index fe538bf..65ec339 100644 --- a/tsconfig.browser.json +++ b/tsconfig.browser.json @@ -4,5 +4,5 @@ {"path": "../../packages/lib/tsconfig.browser.json"}, {"path": "../../packages/web_ui/tsconfig.browser.json"} ], - "include": ["web/**/*.tsx", "web/**/*.ts", "index.ts", "package.json"] + "include": ["index.ts", "package.json"] } \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..5db067d --- /dev/null +++ b/vite.config.js @@ -0,0 +1,6 @@ +import { defineConfig } from "vite"; +import { clusterioPlugin } from "@clusterio/web_ui/vite.mjs"; + +export default defineConfig({ + plugins: [clusterioPlugin()], +}); diff --git a/web/index.tsx b/web/index.tsx deleted file mode 100644 index a14ba85..0000000 --- a/web/index.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import {type WebPluginContext} from '@clusterio/web_ui'; - -export default async function loadWebPlugin(context: WebPluginContext) { -} diff --git a/webpack.config.cjs b/webpack.config.cjs deleted file mode 100644 index 739b384..0000000 --- a/webpack.config.cjs +++ /dev/null @@ -1,28 +0,0 @@ -'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 = {}, argv = {}) => merge(common(env, argv), { - context: __dirname, - entry: './web/index.tsx', - output: { - path: path.resolve(__dirname, 'dist', 'web'), - }, - plugins: [ - new webpack.container.ModuleFederationPlugin({ - name: 'chat_relay', - library: {type: 'var', name: 'plugin_chat_relay'}, - exposes: { - './': './index.ts', - './package.json': './package.json', - './web': './web/index.tsx', - }, - shared: { - '@clusterio/lib': {import: false}, - '@clusterio/web_ui': {import: false}, - }, - }), - ], -});