diff --git a/.changeset/soft-beers-hunt.md b/.changeset/soft-beers-hunt.md new file mode 100644 index 00000000000..c774002f608 --- /dev/null +++ b/.changeset/soft-beers-hunt.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Bug fix: statically loading a resource would result in an increase in bundle size for `clerk.browser.js`. diff --git a/packages/clerk-js/src/ui/lazyModules/providers.tsx b/packages/clerk-js/src/ui/lazyModules/providers.tsx index e1f63635e55..74244e232d6 100644 --- a/packages/clerk-js/src/ui/lazyModules/providers.tsx +++ b/packages/clerk-js/src/ui/lazyModules/providers.tsx @@ -2,7 +2,6 @@ import type { Appearance } from '@clerk/types'; import React, { lazy, Suspense } from 'react'; import type { FlowMetadata } from '../elements'; -import { VirtualBodyRootPortal } from '../portal'; import type { ThemableCssProp } from '../styledSystem'; import type { ClerkComponentName } from './components'; import { ClerkComponents } from './components'; @@ -14,6 +13,7 @@ const AppearanceProvider = lazy(() => import('../customizables').then(m => ({ de const VirtualRouter = lazy(() => import('../router').then(m => ({ default: m.VirtualRouter }))); const InternalThemeProvider = lazy(() => import('../styledSystem').then(m => ({ default: m.InternalThemeProvider }))); const Portal = lazy(() => import('./../portal').then(m => ({ default: m.Portal }))); +const VirtualBodyRootPortal = lazy(() => import('./../portal').then(m => ({ default: m.VirtualBodyRootPortal }))); const FlowMetadataProvider = lazy(() => import('./../elements').then(m => ({ default: m.FlowMetadataProvider }))); const Modal = lazy(() => import('./../elements').then(m => ({ default: m.Modal })));