From: marina Date: Fri, 10 Jan 2025 05:54:15 +0000 (+0300) Subject: ERP-274 Ввести версионность js и css файлов X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b4e15c3904bb6852820d23d6c3e005bfa83899b8;p=erp24_rep%2Fyii-erp24%2F.git ERP-274 Ввести версионность js и css файлов --- diff --git a/erp24/build.js b/erp24/build.js index 4a47a98c..c308ef10 100644 --- a/erp24/build.js +++ b/erp24/build.js @@ -25,6 +25,8 @@ async function buildJs(entryPoints = {}) { format: 'esm', platform: 'browser', outdir: config.outputPath + '/js', + entryNames: '[name].[hash]', //хеш в имени файла + assetNames: '[name].[hash]', // для ассетов тоже добавим хеш в имя }; let result = await esbuild.build(options).catch(err => { @@ -56,6 +58,7 @@ async function buildCss(entryPoints = {}) { '.jpg': 'dataurl' }, outdir: config.outputPath + '/css', + entryNames: '[name].[hash]', // добавляем хеш в имя файла }; let result = await esbuild.build(options).catch(err => { @@ -64,6 +67,7 @@ async function buildCss(entryPoints = {}) { }); } + (async () => { await buildJs({ 'error-log': config.inputPath + 'js/error-log/index.js', diff --git a/erp24/web/js/timetable/start.js b/erp24/web/js/timetable/start.js index f6df3233..ecbe0276 100755 --- a/erp24/web/js/timetable/start.js +++ b/erp24/web/js/timetable/start.js @@ -136,6 +136,7 @@ import TimetableSlot from "./Model/TimetableSlot"; headers: {'Accept': 'application/json', 'X-Requested-With': 'XMLHttpRequest'}, body: form }).then(function(response) { + console.log('check versionnost') return response.json(); }, function (error) { window.reportError(error.message);