2021-01-14 02:59:08 +01:00
|
|
|
import { webpack } from 'next/dist/compiled/webpack/webpack'
|
2021-07-20 20:42:29 +02:00
|
|
|
import { NextConfigComplete } from '../../../server/config-shared'
|
2019-12-09 21:08:15 +01:00
|
|
|
|
|
|
|
export type ConfigurationContext = {
|
2021-11-03 19:38:04 +01:00
|
|
|
supportedBrowsers: string[] | undefined
|
2019-12-09 21:08:15 +01:00
|
|
|
rootDirectory: string
|
2021-08-19 10:12:12 +02:00
|
|
|
customAppFile: RegExp
|
2019-12-09 21:08:15 +01:00
|
|
|
|
|
|
|
isDevelopment: boolean
|
|
|
|
isProduction: boolean
|
|
|
|
|
|
|
|
isServer: boolean
|
|
|
|
isClient: boolean
|
2022-02-08 14:16:46 +01:00
|
|
|
isEdgeRuntime: boolean
|
2021-10-26 18:50:56 +02:00
|
|
|
targetWeb: 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
|
|
|
|
2021-07-20 20:42:29 +02:00
|
|
|
future: NextConfigComplete['future']
|
2021-10-25 01:54:16 +02:00
|
|
|
experimental: NextConfigComplete['experimental']
|
2019-12-09 21:08:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export type ConfigurationFn = (
|
|
|
|
a: webpack.Configuration
|
|
|
|
) => webpack.Configuration
|
|
|
|
|
2021-08-17 09:18:08 +02:00
|
|
|
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
|
|
|
|
)
|