Skip to content

Commit

Permalink
fix(bundler-webpack): custom css modules ident function should only f…
Browse files Browse the repository at this point in the history
…or ssr with bundler esbuild (#11759)
  • Loading branch information
sorrycc authored Oct 19, 2023
1 parent a9dd52a commit cd327af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/bundler-webpack/src/config/cssRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ export async function addCSSRules(opts: IOpts) {
});
}

// If SSR is enabled, we need to handling the css modules name hashing
// If SSR with bundler esbuild is enabled, we need to handling the css modules name hashing
// and save the class names mapping into opts.cssModulesMapping
// so the esbuild can use it to generate the correct name for the server side
const getLocalIdent = userConfig.ssr && getLocalIdentForSSR;
const getLocalIdent =
userConfig.ssr && userConfig.ssr.compiler === 'esbuild'
? getLocalIdentForSSR
: undefined;
const localIdentName = '[local]___[hash:base64:5]';

let cssLoaderModulesConfig: any;
Expand Down

0 comments on commit cd327af

Please sign in to comment.