import type Config from 'webpack-chain' ; import path from 'path' ; import type { ConfigManager } from '../../../config/configManager' ; import { extensions } from '../../../config/constants' ; export default ( configManager ) => ( config ) => { const { rootDir , modern , buildType } = configManager ; config . resolve . mainFields . merge ( [ ... ( modern && buildType === 'client' ? [ 'es2017' , 'es2016' , 'es2015' ] : [ ] ) , buildType === 'client' && 'browser' , 'module' , 'main' , ] . filter ( Boolean ) ) ; config . resolve . extensions . merge ( extensions ) . end ( ) . alias . set ( 'packages/products/components' , path . resolve ( rootDir , 'apps/products/components' ) ) . set ( 'packages/pfpcards/components' , path . resolve ( rootDir , 'apps/pfpcards/components' ) ) . set ( 'offersContext' , path . resolve ( rootDir , 'packages/offers/dependencies' ) ) . set ( 'appointmentContext' , path . resolve ( rootDir , 'apps/accounts/packages/appointment/dependencies' ) ) . end ( ) . modules . add ( 'node_modules' ) . add ( path . resolve ( __dirname , '..' , '..' , '..' , '..' , 'node_modules' ) ) . end ( ) . end ( ) ; } ;