chore: enable HMR

This commit is contained in:
Danish Arora 2025-10-23 13:56:25 +05:30
parent a38723999a
commit b7e271a0d7
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
3 changed files with 21 additions and 4 deletions

View File

@ -36,8 +36,12 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"],
"@opchan/core": ["../packages/core/src/index.ts"],
"@opchan/core/*": ["../packages/core/src/*"],
"@opchan/react": ["../packages/react/src/index.ts"],
"@opchan/react/*": ["../packages/react/src/*"]
} }
}, },
"include": ["src"] "include": ["src", "../packages/core/src", "../packages/react/src"]
} }

View File

@ -7,16 +7,29 @@ export default defineConfig(() => ({
server: { server: {
host: '::', host: '::',
port: 8080, port: 8080,
watch: {
// Watch source files in local packages for hot reload
ignored: ['!**/node_modules/@opchan/**'],
},
fs: {
// Allow serving files from the monorepo root
allow: ['..'],
},
}, },
plugins: [react()], plugins: [react()],
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, './src'), '@': path.resolve(__dirname, './src'),
buffer: 'buffer', buffer: 'buffer',
// Point to source files instead of dist for hot reloading
'@opchan/core': path.resolve(__dirname, '../packages/core/src/index.ts'),
'@opchan/react': path.resolve(__dirname, '../packages/react/src/index.ts'),
}, },
}, },
optimizeDeps: { optimizeDeps: {
include: ['buffer', '@opchan/core', '@opchan/hooks'], include: ['buffer'],
// Exclude local packages from pre-bundling to enable hot reload
exclude: ['@opchan/core', '@opchan/react'],
}, },
build: { build: {
target: 'es2022', target: 'es2022',

View File

@ -29,7 +29,7 @@ export * from './lib/forum/transformers';
// Export services // Export services
export { BookmarkService } from './lib/services/BookmarkService'; export { BookmarkService } from './lib/services/BookmarkService';
export { MessageService } from './lib/services/MessageService'; export { MessageService } from './lib/services/MessageService';
export { UserIdentityService, UserIdentity } from './lib/services/UserIdentityService'; export { UserIdentityService, type UserIdentity } from './lib/services/UserIdentityService';
export { ordinals } from './lib/services/Ordinals'; export { ordinals } from './lib/services/Ordinals';
// Export utilities // Export utilities