Skip to content

Commit 66132f9

Browse files
committed
feat: return the [folder] template
return code accidentally removed Closes webpack-contrib#1371
1 parent 1399707 commit 66132f9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/utils.js

+13
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,19 @@ function defaultGetLocalIdent(
416416
data
417417
);
418418

419+
if (options.regExp) {
420+
const match = loaderContext.resourcePath.match(options.regExp);
421+
422+
if (match) {
423+
match.forEach((matched, i) => {
424+
interpolatedFilename = interpolatedFilename.replace(
425+
new RegExp(`\\[${i}\\]`, "ig"),
426+
matched
427+
);
428+
});
429+
}
430+
}
431+
419432
if (localIdentName.includes("[folder]")) {
420433
interpolatedFilename = resolveFolderTemplate(
421434
loaderContext,

0 commit comments

Comments
 (0)