import type { Provider } from '@tinkoff/dippy' ; import { webpack } from 'webpack' ; import { SERVER_CONFIG_MANAGER_TOKEN , WEBPACK_SERVER_CONFIG_TOKEN , WEBPACK_SERVER_COMPILER_TOKEN , } from '../../tokens' ; import { CONFIG_MANAGER_TOKEN } from '../../../../di/tokens' ; import { webpackServerConfig } from '../../../../library/webpack/child-app/server/prod' ; import { toWebpackConfig } from '../../../../library/webpack/utils/toWebpackConfig' ; export const serverProviders = [ { provide : SERVER_CONFIG_MANAGER_TOKEN , useFactory : ( { configManager } ) => { return configManager . withSettings ( { buildType : 'server' , } ) ; } , deps : { configManager : CONFIG_MANAGER_TOKEN , } , } , { provide : WEBPACK_SERVER_CONFIG_TOKEN , useFactory : webpackServerConfig , deps : { configManager : SERVER_CONFIG_MANAGER_TOKEN , } , } , { provide : WEBPACK_SERVER_COMPILER_TOKEN , useFactory : ( { webpackConfig } ) => { return webpack ( toWebpackConfig ( webpackConfig ) ) ; } , deps : { webpackConfig : WEBPACK_SERVER_CONFIG_TOKEN , } , } , ] ;