From 019ffc25f014294bce7c80fb36bb164aa99c5984 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 28 Oct 2020 19:01:23 +0100 Subject: [PATCH] Add context to webpack configs 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 --- package.json | 2 ++ packages/master/package.json | 2 -- packages/master/webpack.config.js | 1 + plugins/global_chat/package.json | 2 -- plugins/global_chat/webpack.config.js | 1 + plugins/research_sync/package.json | 2 -- plugins/research_sync/webpack.config.js | 1 + plugins/statistics_exporter/package.json | 2 -- plugins/statistics_exporter/webpack.config.js | 1 + plugins/subspace_storage/package.json | 2 -- plugins/subspace_storage/webpack.config.js | 1 + 11 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index bf526b27..8d33925a 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "node": ">=10.16 <11 || >= 12" }, "devDependencies": { + "@babel/core": "^7.12.3", + "@babel/preset-react": "^7.12.1", "@clusterio/ctl": "file:./packages/ctl", "@clusterio/lib": "file:./packages/lib", "@clusterio/master": "file:packages/master", diff --git a/packages/master/package.json b/packages/master/package.json index 3f9dbc7f..68cdb84e 100644 --- a/packages/master/package.json +++ b/packages/master/package.json @@ -35,8 +35,6 @@ "yargs": "^14.2.0" }, "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-react": "^7.10.4", "@clusterio/web_ui": "^2.0.0-alpha.1", "babel-loader": "^8.1.0", "css-loader": "^4.3.0", diff --git a/packages/master/webpack.config.js b/packages/master/webpack.config.js index 01ebb289..756d809d 100644 --- a/packages/master/webpack.config.js +++ b/packages/master/webpack.config.js @@ -6,6 +6,7 @@ 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", diff --git a/plugins/global_chat/package.json b/plugins/global_chat/package.json index 21e3955c..c3c11791 100644 --- a/plugins/global_chat/package.json +++ b/plugins/global_chat/package.json @@ -17,8 +17,6 @@ "@clusterio/lib": "^2.0.0-alpha.0" }, "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-react": "^7.10.4", "@clusterio/web_ui": "^2.0.0-alpha.1", "babel-loader": "^8.1.0", "null-loader": "^4.0.0", diff --git a/plugins/global_chat/webpack.config.js b/plugins/global_chat/webpack.config.js index c036c0a2..042295a4 100644 --- a/plugins/global_chat/webpack.config.js +++ b/plugins/global_chat/webpack.config.js @@ -6,6 +6,7 @@ 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: { filename: "bundle.js", diff --git a/plugins/research_sync/package.json b/plugins/research_sync/package.json index 8933c81c..bca53ca3 100644 --- a/plugins/research_sync/package.json +++ b/plugins/research_sync/package.json @@ -20,8 +20,6 @@ "fs-extra": "^8.1.0" }, "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-react": "^7.10.4", "@clusterio/web_ui": "^2.0.0-alpha.1", "babel-loader": "^8.1.0", "null-loader": "^4.0.0", diff --git a/plugins/research_sync/webpack.config.js b/plugins/research_sync/webpack.config.js index f4de2479..4a519c63 100644 --- a/plugins/research_sync/webpack.config.js +++ b/plugins/research_sync/webpack.config.js @@ -6,6 +6,7 @@ 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: { filename: "bundle.js", diff --git a/plugins/statistics_exporter/package.json b/plugins/statistics_exporter/package.json index 0083efcd..3d271cd2 100644 --- a/plugins/statistics_exporter/package.json +++ b/plugins/statistics_exporter/package.json @@ -17,8 +17,6 @@ "@clusterio/lib": "^2.0.0-alpha.0" }, "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-react": "^7.10.4", "@clusterio/web_ui": "^2.0.0-alpha.1", "babel-loader": "^8.1.0", "null-loader": "^4.0.0", diff --git a/plugins/statistics_exporter/webpack.config.js b/plugins/statistics_exporter/webpack.config.js index 4f231c84..3198c71e 100644 --- a/plugins/statistics_exporter/webpack.config.js +++ b/plugins/statistics_exporter/webpack.config.js @@ -6,6 +6,7 @@ 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: { filename: "bundle.js", diff --git a/plugins/subspace_storage/package.json b/plugins/subspace_storage/package.json index 540db0b0..afb3e970 100644 --- a/plugins/subspace_storage/package.json +++ b/plugins/subspace_storage/package.json @@ -20,8 +20,6 @@ "fs-extra": "^8.1.0" }, "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-react": "^7.10.4", "@clusterio/web_ui": "^2.0.0-alpha.1", "antd": "^4.6.5", "babel-loader": "^8.1.0", diff --git a/plugins/subspace_storage/webpack.config.js b/plugins/subspace_storage/webpack.config.js index cc88fe4e..4a7b4901 100644 --- a/plugins/subspace_storage/webpack.config.js +++ b/plugins/subspace_storage/webpack.config.js @@ -6,6 +6,7 @@ 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: { filename: "bundle.js",