From 8285df487f5b9b14a2607c3ea4e96575c6cb9ff2 Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 7 Oct 2025 06:24:33 +0100 Subject: [PATCH] revert: use documented applesauce imports; remove alias shim - Import EventStore from 'applesauce-core' - Remove Vite alias/shim and node:path reference - Keep config minimal and standard-compliant --- src/App.tsx | 2 +- vite.config.ts | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8eb6438e..ac727625 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,7 @@ import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faSpinner } from '@fortawesome/free-solid-svg-icons' import { EventStoreProvider, AccountsProvider, Hooks } from 'applesauce-react' -import { EventStore } from 'applesauce-core/dist/event-store/event-store.js' +import { EventStore } from 'applesauce-core' import { AccountManager } from 'applesauce-accounts' import { registerCommonAccountTypes } from 'applesauce-accounts/accounts' import { RelayPool } from 'applesauce-relay' diff --git a/vite.config.ts b/vite.config.ts index bd9fb103..d5eeac76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,8 +1,5 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error Node built-in types may be missing in editor, available at build time -import path from 'node:path' export default defineConfig({ plugins: [react()], @@ -13,12 +10,7 @@ export default defineConfig({ extensions: ['.js', '.ts', '.tsx', '.json'], conditions: ['import', 'module', 'browser', 'default'], preserveSymlinks: false, - mainFields: ['module', 'jsnext:main', 'jsnext', 'main'], - alias: { - // applesauce-core publishes async-event-store.js in some environments, but exports map can block deep resolution on Vercel - // We don't use the async store; stub it to avoid bundler trying to resolve it - 'applesauce-core/dist/event-store/async-event-store.js': path.resolve(new URL('./src/shims/applesauce/async-event-store.js', import.meta.url).pathname) - } + mainFields: ['module', 'jsnext:main', 'jsnext', 'main'] }, optimizeDeps: { include: ['applesauce-core', 'applesauce-factory', 'applesauce-relay', 'applesauce-react'],