Add _RUFFLE_VERSION_ global Vite define

This commit is contained in:
CenTdemeern1 2024-12-07 15:59:55 +01:00
parent feb23be80b
commit 034682f7ac
5 changed files with 5 additions and 2 deletions

View file

@ -14,6 +14,7 @@ declare const _PERF_PREFIX_: string;
declare const _DATA_TRANSFER_DRIVE_FILE_: string;
declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
declare const _DATA_TRANSFER_DECK_COLUMN_: string;
declare const _RUFFLE_VERSION_: string;
// for dev-mode
declare const _LANGS_FULL_: string[][];

View file

@ -15,6 +15,7 @@ declare const _PERF_PREFIX_: string;
declare const _DATA_TRANSFER_DRIVE_FILE_: string;
declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
declare const _DATA_TRANSFER_DECK_COLUMN_: string;
declare const _RUFFLE_VERSION_: string;
// for dev-mode
declare const _LANGS_FULL_: string[][];

View file

@ -14,6 +14,7 @@ declare const _PERF_PREFIX_: string;
declare const _DATA_TRANSFER_DRIVE_FILE_: string;
declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
declare const _DATA_TRANSFER_DECK_COLUMN_: string;
declare const _RUFFLE_VERSION_: string;
// for dev-mode
declare const _LANGS_FULL_: string[][];

View file

@ -59,7 +59,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { ref, computed, onDeactivated } from 'vue';
import * as Misskey from 'misskey-js';
import packageInfo from '../../package.json';
import MkEllipsis from '@/components/global/MkEllipsis.vue';
import MkLoading from '@/components/global/MkLoading.vue';
import { i18n } from '@/i18n.js';
@ -110,7 +109,7 @@ async function loadRuffle() {
window.RufflePlayer.config = {
// Options affecting the whole page
'publicPath': `https://raw.esm.sh/@ruffle-rs/ruffle@${packageInfo.dependencies['@ruffle-rs/ruffle']}/`,
'publicPath': `https://raw.esm.sh/@ruffle-rs/ruffle@${_RUFFLE_VERSION_}/`,
'polyfills': false,
// Options affecting files only

View file

@ -134,6 +134,7 @@ export function getConfig(): UserConfig {
_DATA_TRANSFER_DECK_COLUMN_: JSON.stringify('mk_deck_column'),
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
_RUFFLE_VERSION_: JSON.stringify(packageInfo.dependencies['@ruffle-rs/ruffle'])
},
build: {