mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(emcn): repair app-wide crash and unstyled UI after package extraction (#5258)
Two regressions from moving emcn into @sim/emcn: 1. optimizePackageImports['@sim/emcn'] rewrote barrel imports to direct subpaths, duplicating the toast module so ToastProvider (layout) and useToast (workspace permissions provider) resolved different ToastContext objects — useToast threw 'must be used within <ToastProvider>' on every workspace route. Removed @sim/emcn from optimizePackageImports. 2. emcn's source left apps/sim's Tailwind content globs (and docs' v4 auto-content scope, which excludes node_modules), so utility classes used only inside emcn components stopped generating and components rendered unstyled. Added the package to apps/sim's Tailwind content and a @source to docs.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
@import "fumadocs-ui/css/neutral.css";
|
||||
@import "fumadocs-ui/css/preset.css";
|
||||
@import "fumadocs-openapi/css/preset.css";
|
||||
@source "../../../packages/emcn/src";
|
||||
|
||||
/* Prevent overscroll bounce effect on the page */
|
||||
html,
|
||||
|
||||
@@ -133,7 +133,6 @@ const nextConfig: NextConfig = {
|
||||
optimizeCss: true,
|
||||
preloadEntriesOnStart: false,
|
||||
optimizePackageImports: [
|
||||
'@sim/emcn',
|
||||
'lodash',
|
||||
'framer-motion',
|
||||
'reactflow',
|
||||
|
||||
@@ -6,6 +6,7 @@ export default {
|
||||
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'../../packages/emcn/src/**/*.{js,ts,jsx,tsx}',
|
||||
'!./app/node_modules/**',
|
||||
'!**/node_modules/**',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user