Skip to content

Commit

Permalink
Merge pull request #83 from tgxn/version
Browse files Browse the repository at this point in the history
add package version
  • Loading branch information
tgxn authored Oct 31, 2023
2 parents 0c46681 + 32aeee4 commit b17e84f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/SiteHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Toaster, toast } from "sonner";

import { BrowserRouter as Router, useNavigate, useLocation } from "react-router-dom";

import Typography from "@mui/joy/Typography";
import Chip from "@mui/joy/Chip";
import Sheet from "@mui/joy/Sheet";
import Box from "@mui/joy/Box";
Expand Down Expand Up @@ -455,7 +456,15 @@ export default function SiteHeader({ height }) {
</Button>
</BasicInfoTooltip>
)}
<BasicInfoTooltip title="View Code & Report Issues on GitHub" variant="outlined">
<BasicInfoTooltip
title={
<Typography sx={{ textAlign: "center" }}>
Code & Issues on GitHub <br />
Version: {process.env.PACKAGE_VERSION}
</Typography>
}
variant="outlined"
>
<IconButton
size="sm"
variant="outlined"
Expand Down
7 changes: 7 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
const webpack = require("webpack");
const path = require("path");

const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");

const package = require("./package.json");
const packageVersion = package.version;

module.exports = {
entry: "./src/index.jsx",
output: {
Expand All @@ -22,6 +26,9 @@ module.exports = {
new CopyWebpackPlugin({
patterns: [{ from: "public", to: "" }],
}),
new webpack.EnvironmentPlugin({
PACKAGE_VERSION: packageVersion,
}),
],
module: {
rules: [
Expand Down

0 comments on commit b17e84f

Please sign in to comment.