rsnext/packages/next/build/webpack/config/utils.ts
Tim Neutkens 5b9ad8da90
Move next-server directory files to server directory (#26756)
* Move next-server directory files to server directory

* Update tests

* Update paths in other places
2021-06-30 13:44:40 +02:00

31 lines
692 B
TypeScript

import { webpack } from 'next/dist/compiled/webpack/webpack'
import { NextConfig } from '../../../server/config'
export type ConfigurationContext = {
rootDirectory: string
customAppFile: string | null
isDevelopment: boolean
isProduction: boolean
isServer: boolean
isClient: boolean
assetPrefix: string
sassOptions: any
productionBrowserSourceMaps: boolean
future: NextConfig['future']
isCraCompat?: boolean
}
export type ConfigurationFn = (
a: webpack.Configuration
) => webpack.Configuration
export const pipe = <R>(...fns: Array<(a: R) => R | Promise<R>>) => (
param: R
) =>
fns.reduce(async (result: R | Promise<R>, next) => next(await result), param)