Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3528fd9

Browse files
fix(interpolateName): don't interpolatedhashType withouthash orcontenthash (#140)
1 parent809b690 commit3528fd9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎lib/interpolateName.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function interpolateName(loaderContext, name, options) {
9191
// `hash` and `contenthash` are same in `loader-utils` context
9292
// let's keep `hash` for backward compatibility
9393
.replace(
94-
/\[(?:([^:\]]+):)?(?:hash||contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
94+
/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
9595
(all,hashType,digestType,maxLength)=>
9696
getHashDigest(content,hashType,digestType,parseInt(maxLength,10))
9797
)

‎test/interpolateName.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ describe('interpolateName()', () => {
124124
'test content',
125125
'modal.1n8osQznuT8jOAwdzg_n.css',
126126
],
127+
// Should not interpret without `hash` or `contenthash`
128+
[
129+
'/lib/components/modal/modal.css',
130+
'[name].[md5::base64:20].[ext]',
131+
'test content',
132+
'modal.[md5::base64:20].css',
133+
],
127134
].forEach((test)=>{
128135
it('should interpolate '+test[0]+' '+test[1],()=>{
129136
constinterpolatedName=loaderUtils.interpolateName(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp