Always load Ruffle from CDN and add it as a dependency
This commit has a long story behind it. Removes Ruffle from /scripts/ and instead always loads the installed version from unpkg, Ruffle's preferred CDN. This requires having unpkg in the CORS rules. Ruffle is also loaded from the CDN in dev mode. To help with this an externalPackages array has been added to the vite dev config. Co-authored-by: Julia Johannesen <julia@insertdomain.name>
This commit is contained in:
parent
b324790592
commit
f88345cb5f
18 changed files with 171 additions and 760 deletions
|
|
@ -45,9 +45,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<script lang="ts" setup>
|
||||
import { ref, nextTick, computed, watch, onDeactivated, onMounted } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import packageInfo from '../../package.json';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import '@/scripts/ruffle/ruffle';
|
||||
import '@ruffle-rs/ruffle';
|
||||
|
||||
const props = defineProps<{
|
||||
flashFile: Misskey.entities.DriveFile
|
||||
|
|
@ -69,7 +70,7 @@ declare global {
|
|||
window.RufflePlayer = window.RufflePlayer || {};
|
||||
window.RufflePlayer.config = {
|
||||
// Options affecting the whole page
|
||||
'publicPath': '/scripts/ruffle/',
|
||||
'publicPath': `https://unpkg.com/@ruffle-rs/ruffle@${packageInfo.dependencies['@ruffle-rs/ruffle']}/`,
|
||||
'polyfills': false,
|
||||
|
||||
// Options affecting files only
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue