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
This commit is contained in:
Gigi
2025-10-07 06:24:33 +01:00
parent d3fad33948
commit 8285df487f
2 changed files with 2 additions and 10 deletions

View File

@@ -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'

View File

@@ -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'],