chore: homepage w package.json; __APP_HOMEPAGE__ w Vite; użycie w shareUtils
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "vue-nonograms-solid",
|
||||
"version": "1.9.13",
|
||||
"homepage": "https://nonograms.7u.pl/",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user