Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/web-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"version": "0.0.1",
"license": "Apache-2.0",
"description": "QuestDB Console",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/questdb/ui.git"
},
"private": true,
"engines": {
"node": ">=16.13.1"
},
Expand Down
28 changes: 16 additions & 12 deletions packages/web-console/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ const Webpack = require("webpack")
const monacoConfig = require("./monaco.config")
require("dotenv").config()

const PORT = 9999
const BACKEND_PORT = 9000
const isProdBuild = process.env.NODE_ENV === "production"
const runBundleAnalyzer = process.env.ANALYZE
const ASSET_PATH = process.env.ASSET_PATH || "/"
const config = {
port: 9999,
backendUrl: "http://127.0.0.1:9000",
assetPath: process.env.ASSET_PATH || "/",
isProduction: process.env.NODE_ENV === "production",
}

if (!process.env.NODE_ENV) {
process.env.NODE_ENV = "development"
Expand Down Expand Up @@ -107,18 +108,18 @@ module.exports = {
compress: true,
host: "localhost",
hot: false,
port: PORT,
port: config.port,
proxy: {
context: ["/imp", "/exp", "/exec", "/chk"],
target: `http://localhost:${BACKEND_PORT}/`,
target: config.backendUrl,
},
},
devtool: isProdBuild ? false : "eval-source-map",
mode: isProdBuild ? "production" : "development",
devtool: config.isProduction ? false : "eval-source-map",
mode: config.isProduction ? "production" : "development",
entry: "./src/index",
output: {
filename: "qdb.js",
publicPath: ASSET_PATH,
publicPath: config.assetPath,
path: path.resolve(__dirname, "dist"),
},
resolve: {
Expand Down Expand Up @@ -147,10 +148,13 @@ module.exports = {
test: /\.s[ac]ss$/i,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
...(isProdBuild ? [] : devLoaders),
...(config.isProduction ? [] : devLoaders),
],
},
plugins: [...basePlugins, ...(isProdBuild ? prodPlugins : devPlugins)],
plugins: [
...basePlugins,
...(config.isProduction ? prodPlugins : devPlugins),
],
stats: {
all: false,
chunks: true,
Expand Down