Skip to content

Commit a30584b

Browse files
Copilotlcharette
andcommitted
Add conditional exports to support both monorepo dev and published builds
- Add "development" condition to exports that points to source TS files - Keep "import" condition for dist/*.js for published use - Update skeleton vite config to resolve development condition - Include both src and dist in package files for dual usage - Restore optimizeDeps.exclude for monorepo development HMR Co-authored-by: lcharette <[email protected]>
1 parent adbba7c commit a30584b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

vite.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export default defineConfig({
1515
appendTo: 'app/assets/main.ts'
1616
})
1717
],
18+
resolve: {
19+
conditions: ['development', 'import']
20+
},
1821
server: {
1922
host: true, // Allows external access (needed for Docker)
2023
strictPort: true,
@@ -46,7 +49,15 @@ export default defineConfig({
4649
// Force optimization of UiKit (not module packages) in dev mode
4750
// to avoid the error:
4851
// "importing binding name 'default' cannot be resolved by star export entries"
52+
// Sprinkle packages are pre-built but during monorepo development we
53+
// still treat them as source code to enable hot module reload
4954
optimizeDeps: {
50-
include: ['uikit', 'uikit/dist/js/uikit-icons']
55+
include: ['uikit', 'uikit/dist/js/uikit-icons'],
56+
exclude: [
57+
'@userfrosting/sprinkle-core',
58+
'@userfrosting/sprinkle-account',
59+
'@userfrosting/sprinkle-admin',
60+
'@userfrosting/theme-pink-cupcake'
61+
]
5162
}
5263
})

0 commit comments

Comments
 (0)