fix: use esnext target, drop vite-plugin-top-level-await
CI / Build & Quality Checks (push) Failing after 5m27s

Plugin crashes with Rollup 4. esnext target supports TLA natively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lotus Bot
2026-05-21 21:07:12 -04:00
parent fa50a45e84
commit 74f2a49543
+1 -10
View File
@@ -6,7 +6,6 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'; import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
import inject from '@rollup/plugin-inject'; import inject from '@rollup/plugin-inject';
import topLevelAwait from 'vite-plugin-top-level-await';
import { VitePWA } from 'vite-plugin-pwa'; import { VitePWA } from 'vite-plugin-pwa';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
@@ -79,23 +78,15 @@ export default defineConfig({
port: 8080, port: 8080,
host: true, host: true,
fs: { fs: {
// Allow serving files from one level up to the project root
allow: ['..'], allow: ['..'],
}, },
}, },
plugins: [ plugins: [
serverMatrixSdkCryptoWasm('/node_modules/.vite/deps/pkg/matrix_sdk_crypto_wasm_bg.wasm'), serverMatrixSdkCryptoWasm('/node_modules/.vite/deps/pkg/matrix_sdk_crypto_wasm_bg.wasm'),
topLevelAwait({
// The export name of top-level await promise for each chunk module
promiseExportName: '__tla',
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: (i) => `__tla_${i}`,
}),
viteStaticCopy(copyFiles), viteStaticCopy(copyFiles),
vanillaExtractPlugin(), vanillaExtractPlugin(),
wasm(), wasm(),
react(), react(),
// Upload source maps to Sentry when auth token is present, then delete maps from dist
...(process.env.SENTRY_AUTH_TOKEN ...(process.env.SENTRY_AUTH_TOKEN
? [ ? [
sentryVitePlugin({ sentryVitePlugin({
@@ -131,7 +122,6 @@ export default defineConfig({
global: 'globalThis', global: 'globalThis',
}, },
plugins: [ plugins: [
// Enable esbuild polyfill plugins
NodeGlobalsPolyfillPlugin({ NodeGlobalsPolyfillPlugin({
process: false, process: false,
buffer: true, buffer: true,
@@ -140,6 +130,7 @@ export default defineConfig({
}, },
}, },
build: { build: {
target: 'esnext',
outDir: 'dist', outDir: 'dist',
sourcemap: process.env.SENTRY_AUTH_TOKEN ? 'hidden' : false, sourcemap: process.env.SENTRY_AUTH_TOKEN ? 'hidden' : false,
copyPublicDir: false, copyPublicDir: false,