From d3a4cd12b8b369a5f63512c25327378e42708bef Mon Sep 17 00:00:00 2001 From: endiliey Date: Thu, 24 Oct 2019 21:47:31 +0700 Subject: [PATCH 1/2] perf(v2): disable hash for css modules localident in dev --- packages/docusaurus/src/webpack/base.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus/src/webpack/base.ts b/packages/docusaurus/src/webpack/base.ts index 8bb749b7b42d..866071e858de 100644 --- a/packages/docusaurus/src/webpack/base.ts +++ b/packages/docusaurus/src/webpack/base.ts @@ -144,7 +144,9 @@ export function createBaseConfig( test: CSS_MODULE_REGEX, use: getStyleLoaders(isServer, { modules: { - localIdentName: `[local]_[hash:base64:4]`, + localIdentName: isProd + ? `[local]_[hash:base64:4]` + : `[local]_[path]`, }, importLoaders: 1, sourceMap: !isProd, From ce5fdc9c1c7adb04fd289e32feadb4d44e0ac896 Mon Sep 17 00:00:00 2001 From: endiliey Date: Thu, 24 Oct 2019 21:51:56 +0700 Subject: [PATCH 2/2] changelog --- CHANGELOG-2.x.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-2.x.md b/CHANGELOG-2.x.md index 2d3a3924fdc5..64d2534e08a7 100644 --- a/CHANGELOG-2.x.md +++ b/CHANGELOG-2.x.md @@ -6,6 +6,7 @@ - Remove empty doc sidebar container - PostCSS preset env now only polyfills Stage 3 features (previously it was stage 2) like Create React App. Stage 2 CSS is considered relatively unstable and subject to change while Stage 3 features will likely become a standard. - Add ability expand all doc items in sidebar (same as `docsSideNavCollapsible` field in v1) +- Disable adding hashes to the generated class names of CSS modules in dev mode. Generating unique identifiers takes some time, which can be saved since including paths to files in class names is enough to avoid collisions. ## 2.0.0-alpha.30