perf(v2): disable hash for css modules localident in dev (#1882)

* perf(v2): disable hash for css modules localident in dev

* changelog
This commit is contained in:
Endi 2019-10-25 14:01:21 +07:00 committed by Yangshun Tay
parent 6afe6b3559
commit 8bcb5dcfce
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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,