chore: homepage w package.json; __APP_HOMEPAGE__ w Vite; użycie w shareUtils

This commit is contained in:
2026-02-12 15:00:00 +01:00
parent b3e08b53fc
commit 4dab0e2c63
3 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
{
"name": "vue-nonograms-solid",
"version": "1.9.13",
"homepage": "https://nonograms.7u.pl/",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -4,7 +4,7 @@ export function buildShareCanvas(data, t, formattedTime) {
const { grid, size, currentDensity, guideUsageCount } = data;
if (!grid || !grid.length) return null;
const appUrl = 'https://nonograms.7u.pl/';
const appUrl = typeof __APP_HOMEPAGE__ !== 'undefined' ? __APP_HOMEPAGE__ : '';
const maxBoard = 640;
const cellSize = Math.max(8, Math.floor(maxBoard / size));
const boardSize = cellSize * size;
@@ -119,7 +119,7 @@ export function buildShareSVG(data, t, formattedTime) {
const { grid, size, currentDensity, guideUsageCount } = data;
if (!grid || !grid.length) return null;
const appUrl = 'https://nonograms.7u.pl/';
const appUrl = typeof __APP_HOMEPAGE__ !== 'undefined' ? __APP_HOMEPAGE__ : '';
const maxBoard = 640;
const cellSize = Math.max(8, Math.floor(maxBoard / size));
const boardSize = cellSize * size;

View File

@@ -5,7 +5,8 @@ import path from 'path'
export default defineConfig({
define: {
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version)
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version),
'__APP_HOMEPAGE__': JSON.stringify(process.env.npm_package_homepage)
},
plugins: [
vue(),