Inject version during build into the frontend
This commit is contained in:
parent
f039f351c1
commit
2ee2e68230
4 changed files with 6 additions and 4 deletions
4
Makefile
4
Makefile
|
@ -19,7 +19,7 @@ build:
|
||||||
|
|
||||||
.PHONY: build-frontend
|
.PHONY: build-frontend
|
||||||
build-frontend:
|
build-frontend:
|
||||||
cd frontend && yarn build
|
export REACT_APP_VERSION="${VERSION}" && cd frontend && yarn build
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: build
|
run: build
|
||||||
|
@ -27,7 +27,7 @@ run: build
|
||||||
|
|
||||||
.PHONY: run-frontend
|
.PHONY: run-frontend
|
||||||
run-frontend:
|
run-frontend:
|
||||||
cd frontend && yarn start
|
export REACT_APP_VERSION="${VERSION}" && cd frontend && yarn start
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
|
|
2
frontend/package.json
vendored
2
frontend/package.json
vendored
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "my",
|
"name": "listmonk",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
|
||||||
<title>listmonk</title>
|
<title>listmonk</title>
|
||||||
|
<script>VERSION = "%REACT_APP_VERSION%";</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
|
|
@ -230,7 +230,8 @@ class Base extends React.Component {
|
||||||
>
|
>
|
||||||
listmonk
|
listmonk
|
||||||
</a>{" "}
|
</a>{" "}
|
||||||
© 2019 {year !== 2019 ? " - " + year : ""} —{" "}
|
© 2019 {year !== 2019 ? " - " + year : ""}.
|
||||||
|
Version { process.env.REACT_APP_VERSION } —{" "}
|
||||||
<a
|
<a
|
||||||
href="https://listmonk.app/docs"
|
href="https://listmonk.app/docs"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
Loading…
Reference in a new issue