import curry from 'lodash.curry' import path from 'path' import webpack, { Configuration, RuleSetRule } from 'webpack' import MiniCssExtractPlugin from '../../../plugins/mini-css-extract-plugin' import { loader } from '../../helpers' import { ConfigurationContext, ConfigurationFn, pipe } from '../../utils' import { getCssModuleLocalIdent } from './getCssModuleLocalIdent' import { getGlobalImportError, getGlobalModuleImportError, getLocalModuleImportError, } from './messages' import { getPostCssPlugins } from './plugins' function getClientStyleLoader({ isDevelopment, assetPrefix, }: { isDevelopment: boolean assetPrefix: string }): webpack.RuleSetUseItem { return isDevelopment ? { loader: require.resolve('style-loader'), options: { // By default, style-loader injects CSS into the bottom // of . This causes ordering problems between dev // and prod. To fix this, we render a