From 9065f63edfcd8c5c4b0d3bf00f2e15e9a1204dbc Mon Sep 17 00:00:00 2001 From: zzzmisa Date: Fri, 26 Mar 2021 19:34:28 +0900 Subject: [PATCH] fix(types): css-loader v4 type definitions (#9053) --- packages/types/config/build.d.ts | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/types/config/build.d.ts b/packages/types/config/build.d.ts index ad19554e1e..03763e518f 100644 --- a/packages/types/config/build.d.ts +++ b/packages/types/config/build.d.ts @@ -26,25 +26,29 @@ import { Options as WebpackDevMiddlewareOptions } from 'webpack-dev-middleware' import { MiddlewareOptions as WebpackHotMiddlewareOptions, ClientOptions as WebpackHotMiddlewareClientOptions } from 'webpack-hot-middleware' type CssLoaderUrlFunction = (url: string, resourcePath: string) => boolean -type CssLoaderImportFunction = (parsedImport: string, resourcePath: string) => boolean +type CssLoaderImportFunction = (url: string, media: string, resourcePath: string) => boolean + type CssLoaderMode = 'global' | 'local' | 'pure' interface CssLoaderModulesOptions { - context?: string - exportLocalsConvention?: 'asIs' | 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' - exportOnlyLocals?: boolean - getLocalIdent?: (context: string, localIdentName: string, localName: string, options: CssLoaderModulesOptions) => string - localIdentHashPrefix?: string - localIdentName?: string - localIdentRegExp?: string | RegExp - mode?: CssLoaderMode + compileType?: 'module' | 'icss', + mode?: CssLoaderMode, + auto?: Boolean | RegExp | ((resourcePath: string) => boolean), + exportGlobals?: boolean, + localIdentName?: string, + context?: string, + localIdentHashPrefix?: string, + namedExport?: boolean, + exportLocalsConvention?: 'asIs' | 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly', + exportOnlyLocals?: boolean, } interface CssLoaderOptions { + url?: boolean | CssLoaderUrlFunction import?: boolean | CssLoaderImportFunction - importLoaders?: number modules?: boolean | CssLoaderMode | CssLoaderModulesOptions sourceMap?: boolean - url?: boolean | CssLoaderUrlFunction + importLoaders?: number + esModule?: boolean } interface UrlLoaderOptions {