Skip to content

Commit

Permalink
perf(v2): disable hash for css modules localident in dev (#1882)
Browse files Browse the repository at this point in the history
* perf(v2): disable hash for css modules localident in dev

* changelog
  • Loading branch information
endiliey authored and yangshun committed Oct 25, 2019
1 parent 6afe6b3 commit 8bcb5dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Default PostCSS loader 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.
- Fix search bar focus bug. When you put the focus on search input, previously the focus will remain although we have clicked to other area outside of the search input.
- New themeConfig option `sidebarCollapsible`. It is on by default. If explicitly set to `false`, all doc items in sidebar is expanded. Otherwise, it will still be a collapsible sidebar.
- 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

Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus/src/webpack/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8bcb5dc

Please sign in to comment.