mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-24 00:56:41 +02:00
♻️ refactor: migrate 15 web apps to @manacore/shared-vite-config
- Add missing packages to MANACORE_SHARED_PACKAGES list - Migrate all SvelteKit apps to use createViteConfig/mergeViteConfig - Matrix preserves special WASM config for matrix-js-sdk crypto - Update consolidation docs with completed Vite config task Savings: ~350 LOC (-318 net lines)
This commit is contained in:
parent
d0d2855adb
commit
188290b427
17 changed files with 225 additions and 513 deletions
|
|
@ -1,38 +1,41 @@
|
|||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import { createViteConfig, mergeViteConfig } from '@manacore/shared-vite-config';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss(), sveltekit()],
|
||||
server: {
|
||||
port: 5180,
|
||||
strictPort: true,
|
||||
headers: {
|
||||
// Required for WASM module loading
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
'Cross-Origin-Embedder-Policy': 'require-corp',
|
||||
},
|
||||
},
|
||||
define: {
|
||||
global: 'globalThis',
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['buffer', 'events'],
|
||||
// WASM modules cannot be pre-bundled
|
||||
exclude: ['@matrix-org/matrix-sdk-crypto-wasm'],
|
||||
esbuildOptions: {
|
||||
define: {
|
||||
global: 'globalThis',
|
||||
const baseConfig = createViteConfig({
|
||||
port: 5180,
|
||||
additionalPackages: ['@matrix/shared'],
|
||||
});
|
||||
|
||||
export default defineConfig(
|
||||
mergeViteConfig(baseConfig, {
|
||||
plugins: [tailwindcss(), sveltekit()],
|
||||
server: {
|
||||
headers: {
|
||||
// Required for WASM module loading
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
'Cross-Origin-Embedder-Policy': 'require-corp',
|
||||
},
|
||||
},
|
||||
},
|
||||
ssr: {
|
||||
noExternal: ['@manacore/shared-*', '@matrix/shared'],
|
||||
},
|
||||
worker: {
|
||||
format: 'es',
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
});
|
||||
define: {
|
||||
global: 'globalThis',
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['buffer', 'events'],
|
||||
// WASM modules cannot be pre-bundled
|
||||
exclude: ['@matrix-org/matrix-sdk-crypto-wasm'],
|
||||
esbuildOptions: {
|
||||
define: {
|
||||
global: 'globalThis',
|
||||
},
|
||||
},
|
||||
},
|
||||
worker: {
|
||||
format: 'es',
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue