@@ -6,19 +6,25 @@ import postcssModules from "postcss-modules";
66import autoPrefixer from "autoprefixer" ;
77import { compile } from "sass" ;
88
9+ /** Craete UUID */
910const uuid = ( ) => ( Date . now ( ) * Math . random ( ) ) . toString ( 36 ) . slice ( 0 , 8 ) ;
1011
1112interface CSSPluginOptions {
12- /** by default name is generated without hash so that it is easier and reliable for library users to override some CSS */
13- generateScopedName ?: string | ( ( className : string , filename : string , css : string ) => string ) ;
13+ /**
14+ * By default name is generated without hash so that it is easier and reliable for library users to override some CSS.
15+ * Refer [loader-utils docs](https://github.com/webpack/loader-utils?tab=readme-ov-file#interpolatename) for more options
16+ * @defaultValue A function that generates name similar to [name]__[local] but without .module
17+ */
18+ generateScopedName ?: string | ( ( className : string , path : string , css : string ) => string ) ;
1419 /** set skipAutoPrefixer to true to disable autoprefixer */
1520 skipAutoPrefixer ?: boolean ;
16- /** global CSS class prefix. @defaultValue "" */
21+ /** global CSS class prefix. @defaultValue undefined */
1722 globalPrefix ?: string ;
18- /** If you want to keep .module.css files */
23+ /** If you want to keep .module.css files. @defaultValue undefined */
1924 keepModules ?: boolean ;
2025}
2126
27+ /** Combine client and server CSS */
2228function generateCombinedCSS ( result : BuildResult ) {
2329 /** generate combined server and client CSS */
2430 const serverRegExp = new RegExp ( `server\\${ path . sep } index\\.css` ) ;
0 commit comments