mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
refactor: added {BUILD_TIME} in path js and css files
This commit is contained in:
@@ -6,6 +6,7 @@ const cssnano = require('cssnano');
|
|||||||
const terser = require('gulp-terser');
|
const terser = require('gulp-terser');
|
||||||
const jsonminify = require('gulp-jsonminify');
|
const jsonminify = require('gulp-jsonminify');
|
||||||
const htmlmin = require('gulp-html-minifier-terser');
|
const htmlmin = require('gulp-html-minifier-terser');
|
||||||
|
const replace = require('gulp-replace');
|
||||||
|
|
||||||
// Paths for tasks
|
// Paths for tasks
|
||||||
let paths = {
|
let paths = {
|
||||||
@@ -119,6 +120,10 @@ const staticFiles = (cb) => {
|
|||||||
|
|
||||||
const pages = () => {
|
const pages = () => {
|
||||||
return src(paths.pages.src)
|
return src(paths.pages.src)
|
||||||
|
.pipe(replace(
|
||||||
|
"{BUILD_TIME}",
|
||||||
|
Math.floor(Date.now() / 1000)
|
||||||
|
))
|
||||||
.pipe(htmlmin({
|
.pipe(htmlmin({
|
||||||
html5: true,
|
html5: true,
|
||||||
caseSensitive: true,
|
caseSensitive: true,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"gulp-html-minifier-terser": "^7.1.0",
|
"gulp-html-minifier-terser": "^7.1.0",
|
||||||
"gulp-jsonminify": "^1.1.0",
|
"gulp-jsonminify": "^1.1.0",
|
||||||
"gulp-postcss": "^10.0.0",
|
"gulp-postcss": "^10.0.0",
|
||||||
"gulp-terser": "^2.1.0"
|
"gulp-terser": "^2.1.0",
|
||||||
|
"gulp-replace": "^1.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title data-i18n>dashboard.title</title>
|
<title data-i18n>dashboard.title</title>
|
||||||
<link rel="stylesheet" href="/static/app.css" />
|
<link rel="stylesheet" href="/static/app.css?{BUILD_TIME}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?{BUILD_TIME}"></script>
|
||||||
<script>
|
<script>
|
||||||
let modifiedTime = null;
|
let modifiedTime = null;
|
||||||
let noRegulators;
|
let noRegulators;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title data-i18n>index.title</title>
|
<title data-i18n>index.title</title>
|
||||||
<link rel="stylesheet" href="/static/app.css" />
|
<link rel="stylesheet" href="/static/app.css?{BUILD_TIME}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?{BUILD_TIME}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
const lang = new Lang(document.getElementById('lang'));
|
const lang = new Lang(document.getElementById('lang'));
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title data-i18n>network.title</title>
|
<title data-i18n>network.title</title>
|
||||||
<link rel="stylesheet" href="/static/app.css" />
|
<link rel="stylesheet" href="/static/app.css?{BUILD_TIME}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?{BUILD_TIME}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
const lang = new Lang(document.getElementById('lang'));
|
const lang = new Lang(document.getElementById('lang'));
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title data-i18n>sensors.title</title>
|
<title data-i18n>sensors.title</title>
|
||||||
<link rel="stylesheet" href="/static/app.css" />
|
<link rel="stylesheet" href="/static/app.css?{BUILD_TIME}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?{BUILD_TIME}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", async () => {
|
document.addEventListener("DOMContentLoaded", async () => {
|
||||||
const lang = new Lang(document.getElementById("lang"));
|
const lang = new Lang(document.getElementById("lang"));
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title data-i18n>settings.title</title>
|
<title data-i18n>settings.title</title>
|
||||||
<link rel="stylesheet" href="/static/app.css" />
|
<link rel="stylesheet" href="/static/app.css?{BUILD_TIME}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -662,7 +662,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?{BUILD_TIME}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
const lang = new Lang(document.getElementById('lang'));
|
const lang = new Lang(document.getElementById('lang'));
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title data-i18n>upgrade.title</title>
|
<title data-i18n>upgrade.title</title>
|
||||||
<link rel="stylesheet" href="/static/app.css">
|
<link rel="stylesheet" href="/static/app.css?{BUILD_TIME}">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?{BUILD_TIME}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
const lang = new Lang(document.getElementById('lang'));
|
const lang = new Lang(document.getElementById('lang'));
|
||||||
|
|||||||
Reference in New Issue
Block a user