2021-01-14 02:59:08 +01:00
|
|
|
import { webpack } from 'next/dist/compiled/webpack/webpack'
|
2021-01-11 18:19:56 +01:00
|
|
|
import { NextConfig } from '../../../next-server/server/config'
|
2019-12-09 21:08:15 +01:00
|
|
|
|
|
|
|
export type ConfigurationContext = {
|
|
|
|
rootDirectory: string
|
|
|
|
customAppFile: string | null
|
|
|
|
|
|
|
|
isDevelopment: boolean
|
|
|
|
isProduction: boolean
|
|
|
|
|
|
|
|
isServer: boolean
|
|
|
|
isClient: boolean
|
2020-01-03 18:45:04 +01:00
|
|
|
|
|
|
|
assetPrefix: string
|
2020-03-16 10:55:16 +01:00
|
|
|
|
|
|
|
sassOptions: any
|
2020-05-17 22:30:42 +02:00
|
|
|
productionBrowserSourceMaps: boolean
|
2021-01-11 18:19:56 +01:00
|
|
|
|
|
|
|
future: NextConfig['future']
|
2019-12-09 21:08:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|