mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
refactor: improved web cache
This commit is contained in:
12
gulpfile.js
12
gulpfile.js
@@ -60,6 +60,10 @@ const styles = (cb) => {
|
||||
const items = paths.styles.bundles[name];
|
||||
|
||||
src(items)
|
||||
.pipe(replace(
|
||||
"{BUILD_TIME}",
|
||||
Math.floor(Date.now() / 1000)
|
||||
))
|
||||
.pipe(postcss([
|
||||
cssnano({ preset: 'advanced' })
|
||||
]))
|
||||
@@ -78,6 +82,10 @@ const scripts = (cb) => {
|
||||
const items = paths.scripts.bundles[name];
|
||||
|
||||
src(items)
|
||||
.pipe(replace(
|
||||
"{BUILD_TIME}",
|
||||
Math.floor(Date.now() / 1000)
|
||||
))
|
||||
.pipe(terser().on('error', console.error))
|
||||
.pipe(concat(name))
|
||||
.pipe(gzip({
|
||||
@@ -94,6 +102,10 @@ const jsonFiles = (cb) => {
|
||||
const item = paths.json[i];
|
||||
|
||||
src(item.src)
|
||||
.pipe(replace(
|
||||
"{BUILD_TIME}",
|
||||
Math.floor(Date.now() / 1000)
|
||||
))
|
||||
.pipe(jsonminify())
|
||||
.pipe(gzip({
|
||||
append: true
|
||||
|
||||
Reference in New Issue
Block a user