refactor: improved web cache

This commit is contained in:
Yurii
2024-11-14 22:30:34 +03:00
parent d3b28c5bfb
commit 34eabca64a
5 changed files with 49 additions and 16 deletions

View File

@@ -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