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