Fix JS polyfills missing after the Vite switch (#34758)

This commit is contained in:
Renaud Chaput 2025-05-21 22:11:01 +02:00 committed by GitHub
parent 6ab96ba647
commit 83dd09d4dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 59 additions and 4 deletions

View file

@ -10,6 +10,7 @@ import RailsPlugin from 'vite-plugin-rails';
import { VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
import yaml from 'js-yaml';
import legacy from '@vitejs/plugin-legacy';
import { defineConfig, UserConfigFnPromise, UserConfig } from 'vite';
import postcssPresetEnv from 'postcss-preset-env';
@ -119,6 +120,10 @@ export const config: UserConfigFnPromise = async ({ mode, command }) => {
}),
MastodonServiceWorkerLocales(),
MastodonEmojiCompressed(),
legacy({
renderLegacyChunks: false,
modernPolyfills: true,
}),
VitePWA({
srcDir: 'mastodon/service_worker',
// We need to use injectManifest because we use our own service worker