build: actualizar dist con la versión de producción más reciente

This commit is contained in:
2026-08-14 16:34:38 -04:00
parent a5fe1f7b27
commit abfd2c4fae
15 changed files with 1794 additions and 350 deletions
+4 -3
View File
@@ -6,6 +6,7 @@ const root = path.resolve(new URL('..', import.meta.url).pathname);
const srcDir = path.join(root, 'src');
const distDir = path.join(root, 'dist');
const assetsDir = path.join(distDir, 'assets');
const BUILD_VERSION = '20260814-single-access-status';
const env = {
VITE_SUPABASE_URL: 'https://dbit.digitalcompass.agency',
@@ -29,7 +30,7 @@ function fixLocalImports(code) {
.replace(/^import\s+["']\.\/styles\.css["'];?\s*$/gm, '')
.replace(/(from\s+["'])(\.\.?\/[^"']+)(["'])/g, (_m, start, spec, end) => {
if (/\.(?:js|mjs|cjs|json|css)$/.test(spec)) return `${start}${spec}${end}`;
return `${start}${spec}.js${end}`;
return `${start}${spec}.js?v=${BUILD_VERSION}${end}`;
});
}
@@ -76,7 +77,7 @@ const indexHtml = `<!doctype html>
<link rel="shortcut icon" type="image/png" href="https://dbit.digitalcompass.agency/storage/v1/object/public/public-assets/GLM.png?v=glm-hub-20260728-access" />
<link rel="apple-touch-icon" href="https://dbit.digitalcompass.agency/storage/v1/object/public/public-assets/GLM.png?v=glm-hub-20260728-access" />
<title>GLM Hub — GomezLee Marketing</title>
<link rel="stylesheet" href="/assets/styles.css" />
<link rel="stylesheet" href="/assets/styles.css?v=${BUILD_VERSION}" />
<script type="importmap">
{
"imports": {
@@ -91,7 +92,7 @@ const indexHtml = `<!doctype html>
<body>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2.110.8"></script>
<script type="module" src="/assets/main.js"></script>
<script type="module" src="/assets/main.js?v=${BUILD_VERSION}"></script>
</body>
</html>`;
fs.writeFileSync(path.join(distDir, 'index.html'), indexHtml);