You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking to import from one the shared libs without the barrel import file (index.ts) so that my bundle files gets smaller.
example:
Before import { blahService } from '@shared-services'
After import { blahService } from '@shared-services/blahservice'
my bundle is right now bloated given importing any of the services is importing all the services, without the barrel imports my bundle size reduce from 250kb to 50kb
BUT the services are getting initated multiple times (twice) i.e blahService logs twice when i put a console.log in its constructor
my tsconfig.base.json "@shared-services/*": ["libs/shared-services/src/lib/*"],
previously this was "@shared-services": ["libs/shared-services/src/index"],
my module-federation.base.config.ts
I am looking to import from one the shared libs without the barrel import file (index.ts) so that my bundle files gets smaller.
example:
Before
import { blahService } from '@shared-services'
After
import { blahService } from '@shared-services/blahservice'
my bundle is right now bloated given importing any of the services is importing all the services, without the barrel imports my bundle size reduce from 250kb to 50kb
BUT
the services are getting initated multiple times (twice) i.e blahService logs twice when i put a console.log in its constructor
my tsconfig.base.json
"@shared-services/*": ["libs/shared-services/src/lib/*"],
previously this was
"@shared-services": ["libs/shared-services/src/index"],
my module-federation.base.config.ts
so how to have a singleton without the barrel imports ?
The text was updated successfully, but these errors were encountered: