Skip to content

Commit 3eab0f9

Browse files
refactor: code
1 parent d66534c commit 3eab0f9

File tree

6 files changed

+476
-25
lines changed

6 files changed

+476
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ Supported template strings:
779779

780780
Recommendations:
781781

782-
- use `'[file]__[local]'` for development
782+
- use `'[path][name]__[local]'` for development
783783
- use `'[hash:base64]'` for production
784784

785785
The `[local]` placeholder contains original class.

package-lock.json

Lines changed: 46 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ function resolveFolderTemplate(loaderContext, localIdentName, options) {
326326
.replace(/\.\.(\/)?/g, "_$1");
327327
directory = directory.substr(0, directory.length - 1);
328328

329-
if (directory.length > 1) {
330-
const folder = path.basename(directory);
329+
let folder = "";
331330

332-
return localIdentName.replace(/\[folder\]/gi, () => folder);
331+
if (directory.length > 1) {
332+
folder = path.basename(directory);
333333
}
334334

335-
return localIdentName;
335+
return localIdentName.replace(/\[folder\]/gi, () => folder);
336336
}
337337

338338
function defaultGetLocalIdent(

0 commit comments

Comments
 (0)