Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit ad39022

Browse files
authoredMar 17, 2020
chore(deps): update (#369)
BREAKING CHANGE: use `md4` by default for hashing
1 parent e1fe27c commit ad39022

13 files changed

+460
-345
lines changed
 

‎README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,14 @@ Same as above, but with a customizable number of emojis
466466
### `[hash]`
467467

468468
Type: `String`
469-
Default: `md5`
469+
Default: `md4`
470470

471471
Specifies the hash method to use for hashing the file content.
472472

473473
### `[contenthash]`
474474

475475
Type: `String`
476-
Default: `md5`
476+
Default: `md4`
477477

478478
Specifies the hash method to use for hashing the file content.
479479

@@ -495,10 +495,9 @@ base49, base52, base58, base62, base64, and hex.
495495
#### `hashType`
496496

497497
Type: `String`
498-
Default: `'md5'`
498+
Default: `'md4'`
499499

500-
The type of hash that the has function should use. Valid values include: `md5`,
501-
`sha1`, `sha256`, and `sha512`.
500+
The type of hash that the has function should use. Valid values include: `md4`, `md5`, `sha1`, `sha256`, and `sha512`.
502501

503502
#### `length`
504503

‎package-lock.json

+390-275
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141
"webpack": "^4.0.0 || ^5.0.0"
4242
},
4343
"dependencies": {
44-
"loader-utils": "^1.4.0",
45-
"schema-utils": "^2.5.0"
44+
"loader-utils": "^2.0.0",
45+
"schema-utils": "^2.6.5"
4646
},
4747
"devDependencies": {
4848
"@babel/cli": "^7.8.4",
49-
"@babel/core": "^7.8.4",
50-
"@babel/preset-env": "^7.8.4",
49+
"@babel/core": "^7.8.7",
50+
"@babel/preset-env": "^7.8.7",
5151
"@commitlint/cli": "^8.3.5",
5252
"@commitlint/config-conventional": "^8.3.4",
5353
"@webpack-contrib/defaults": "^6.3.0",
5454
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
5555
"babel-jest": "^25.1.0",
5656
"commitlint-azure-pipelines-cli": "^1.0.3",
57-
"cross-env": "^7.0.0",
57+
"cross-env": "^7.0.2",
5858
"del": "^5.1.0",
5959
"del-cli": "^3.0.0",
6060
"eslint": "^6.8.0",
@@ -63,14 +63,14 @@
6363
"husky": "^4.2.3",
6464
"jest": "^25.1.0",
6565
"jest-junit": "^10.0.0",
66-
"lint-staged": "^10.0.7",
67-
"memfs": "^3.1.1",
66+
"lint-staged": "^10.0.8",
67+
"memfs": "^3.1.2",
6868
"memory-fs": "^0.5.0",
6969
"npm-run-all": "^4.1.5",
7070
"prettier": "^1.19.1",
7171
"standard-version": "^7.1.0",
7272
"url-loader": "^3.0.0",
73-
"webpack": "^4.41.6"
73+
"webpack": "^4.42.0"
7474
},
7575
"keywords": [
7676
"webpack"

‎src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import validateOptions from 'schema-utils';
66
import schema from './options.json';
77

88
export default function loader(content) {
9-
const options = loaderUtils.getOptions(this) || {};
9+
const options = loaderUtils.getOptions(this);
1010

1111
validateOptions(schema, options, {
1212
name: 'File Loader',

‎test/__snapshots__/emitFile-option.test.js.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ Array [
88

99
exports[`"emitFile" option should work with "Boolean" value equal "false": errors 1`] = `Array []`;
1010

11-
exports[`"emitFile" option should work with "Boolean" value equal "false": result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
11+
exports[`"emitFile" option should work with "Boolean" value equal "false": result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
1212

1313
exports[`"emitFile" option should work with "Boolean" value equal "false": warnings 1`] = `Array []`;
1414

1515
exports[`"emitFile" option should work with "Boolean" value equal "true": assets 1`] = `
1616
Array [
17-
"9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
17+
"39f5c21c1aee6ff21844c6e1d8251d97.png",
1818
"main.bundle.js",
1919
]
2020
`;
2121

2222
exports[`"emitFile" option should work with "Boolean" value equal "true": errors 1`] = `Array []`;
2323

24-
exports[`"emitFile" option should work with "Boolean" value equal "true": result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
24+
exports[`"emitFile" option should work with "Boolean" value equal "true": result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
2525

2626
exports[`"emitFile" option should work with "Boolean" value equal "true": warnings 1`] = `Array []`;
2727

2828
exports[`"emitFile" option should work without value: assets 1`] = `
2929
Array [
30-
"9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
30+
"39f5c21c1aee6ff21844c6e1d8251d97.png",
3131
"main.bundle.js",
3232
]
3333
`;
3434

3535
exports[`"emitFile" option should work without value: errors 1`] = `Array []`;
3636

37-
exports[`"emitFile" option should work without value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
37+
exports[`"emitFile" option should work without value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
3838

3939
exports[`"emitFile" option should work without value: warnings 1`] = `Array []`;

‎test/__snapshots__/esModule-option.test.js.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
exports[`"esModule" option should work with "Boolean" value equal "false": errors 1`] = `Array []`;
44

5-
exports[`"esModule" option should work with "Boolean" value equal "false": result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
5+
exports[`"esModule" option should work with "Boolean" value equal "false": result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
66

77
exports[`"esModule" option should work with "Boolean" value equal "false": warnings 1`] = `Array []`;
88

99
exports[`"esModule" option should work with "Boolean" value equal "true": errors 1`] = `Array []`;
1010

11-
exports[`"esModule" option should work with "Boolean" value equal "true": result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
11+
exports[`"esModule" option should work with "Boolean" value equal "true": result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
1212

1313
exports[`"esModule" option should work with "Boolean" value equal "true": warnings 1`] = `Array []`;
1414

1515
exports[`"esModule" option should work without value: errors 1`] = `Array []`;
1616

17-
exports[`"esModule" option should work without value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
17+
exports[`"esModule" option should work without value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
1818

1919
exports[`"esModule" option should work without value: warnings 1`] = `Array []`;

‎test/__snapshots__/loader.test.js.snap

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
exports[`loader should work with "ModuleConcatenationPlugin" plugin: assets 1`] = `
44
Array [
5-
"9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
5+
"39f5c21c1aee6ff21844c6e1d8251d97.png",
66
"main.bundle.js",
77
]
88
`;
99

1010
exports[`loader should work with "ModuleConcatenationPlugin" plugin: errors 1`] = `Array []`;
1111

12-
exports[`loader should work with "ModuleConcatenationPlugin" plugin: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
12+
exports[`loader should work with "ModuleConcatenationPlugin" plugin: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
1313

1414
exports[`loader should work with "ModuleConcatenationPlugin" plugin: warnings 1`] = `Array []`;
1515

1616
exports[`loader should work with "url-loader" when limit is less: assets 1`] = `
1717
Array [
18-
"9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
18+
"39f5c21c1aee6ff21844c6e1d8251d97.png",
1919
"main.bundle.js",
2020
]
2121
`;
2222

2323
exports[`loader should work with "url-loader" when limit is less: errors 1`] = `Array []`;
2424

25-
exports[`loader should work with "url-loader" when limit is less: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
25+
exports[`loader should work with "url-loader" when limit is less: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
2626

2727
exports[`loader should work with "url-loader" when limit is less: warnings 1`] = `Array []`;
2828

@@ -40,13 +40,13 @@ exports[`loader should works with "url-loader" when limit is more: warnings 1`]
4040

4141
exports[`loader should works without options: assets 1`] = `
4242
Array [
43-
"9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
43+
"39f5c21c1aee6ff21844c6e1d8251d97.png",
4444
"main.bundle.js",
4545
]
4646
`;
4747

4848
exports[`loader should works without options: errors 1`] = `Array []`;
4949

50-
exports[`loader should works without options: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
50+
exports[`loader should works without options: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
5151

5252
exports[`loader should works without options: warnings 1`] = `Array []`;

‎test/__snapshots__/name-option.test.js.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ exports[`"name" option should work for CDN support query params: warnings 1`] =
88

99
exports[`"name" option should work with "Function" value: errors 1`] = `Array []`;
1010

11-
exports[`"name" option should work with "Function" value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.function.png?foo=bar"`;
11+
exports[`"name" option should work with "Function" value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.function.png?foo=bar"`;
1212

1313
exports[`"name" option should work with "Function" value: warnings 1`] = `Array []`;
1414

1515
exports[`"name" option should work with "String" value: errors 1`] = `Array []`;
1616

17-
exports[`"name" option should work with "String" value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.string.png?foo=bar"`;
17+
exports[`"name" option should work with "String" value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.string.png?foo=bar"`;
1818

1919
exports[`"name" option should work with "String" value: warnings 1`] = `Array []`;
2020

2121
exports[`"name" option should work without value: errors 1`] = `Array []`;
2222

23-
exports[`"name" option should work without value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
23+
exports[`"name" option should work without value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
2424

2525
exports[`"name" option should work without value: warnings 1`] = `Array []`;

‎test/__snapshots__/outputPath-option.test.js.snap

+18-18
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,40 @@ exports[`"outputPath" option should work with "Function" value and with "name" o
1515

1616
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "Function": assets 1`] = `
1717
Array [
18-
"output_path_func/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
18+
"output_path_func/39f5c21c1aee6ff21844c6e1d8251d97.png",
1919
"main.bundle.js",
2020
]
2121
`;
2222

2323
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "Function": errors 1`] = `Array []`;
2424

25-
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "Function": result 1`] = `"public_path_func/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
25+
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "Function": result 1`] = `"public_path_func/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
2626

2727
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "Function": warnings 1`] = `Array []`;
2828

2929
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "String": assets 1`] = `
3030
Array [
31-
"output_path_func/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
31+
"output_path_func/39f5c21c1aee6ff21844c6e1d8251d97.png",
3232
"main.bundle.js",
3333
]
3434
`;
3535

3636
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "String": errors 1`] = `Array []`;
3737

38-
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "String": result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
38+
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "String": result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
3939

4040
exports[`"outputPath" option should work with "Function" value and with "publicPath" as "String": warnings 1`] = `Array []`;
4141

4242
exports[`"outputPath" option should work with "Function" value: assets 1`] = `
4343
Array [
44-
"output_path_func/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
44+
"output_path_func/39f5c21c1aee6ff21844c6e1d8251d97.png",
4545
"main.bundle.js",
4646
]
4747
`;
4848

4949
exports[`"outputPath" option should work with "Function" value: errors 1`] = `Array []`;
5050

51-
exports[`"outputPath" option should work with "Function" value: result 1`] = `"output_path_func/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
51+
exports[`"outputPath" option should work with "Function" value: result 1`] = `"output_path_func/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
5252

5353
exports[`"outputPath" option should work with "Function" value: warnings 1`] = `Array []`;
5454

@@ -67,78 +67,78 @@ exports[`"outputPath" option should work with "String" value and with "name" opt
6767

6868
exports[`"outputPath" option should work with "String" value and with "publicPath" as "Function": assets 1`] = `
6969
Array [
70-
"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
70+
"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png",
7171
"main.bundle.js",
7272
]
7373
`;
7474

7575
exports[`"outputPath" option should work with "String" value and with "publicPath" as "Function": errors 1`] = `Array []`;
7676

77-
exports[`"outputPath" option should work with "String" value and with "publicPath" as "Function": result 1`] = `"public_path_func/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
77+
exports[`"outputPath" option should work with "String" value and with "publicPath" as "Function": result 1`] = `"public_path_func/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
7878

7979
exports[`"outputPath" option should work with "String" value and with "publicPath" as "Function": warnings 1`] = `Array []`;
8080

8181
exports[`"outputPath" option should work with "String" value and with "publicPath" option and without trailing slash: assets 1`] = `
8282
Array [
83-
"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
83+
"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png",
8484
"main.bundle.js",
8585
]
8686
`;
8787

8888
exports[`"outputPath" option should work with "String" value and with "publicPath" option and without trailing slash: errors 1`] = `Array []`;
8989

90-
exports[`"outputPath" option should work with "String" value and with "publicPath" option and without trailing slash: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
90+
exports[`"outputPath" option should work with "String" value and with "publicPath" option and without trailing slash: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
9191

9292
exports[`"outputPath" option should work with "String" value and with "publicPath" option and without trailing slash: warnings 1`] = `Array []`;
9393

9494
exports[`"outputPath" option should work with "String" value and with "publicPath" option: assets 1`] = `
9595
Array [
96-
"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
96+
"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png",
9797
"main.bundle.js",
9898
]
9999
`;
100100

101101
exports[`"outputPath" option should work with "String" value and with "publicPath" option: errors 1`] = `Array []`;
102102

103-
exports[`"outputPath" option should work with "String" value and with "publicPath" option: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
103+
exports[`"outputPath" option should work with "String" value and with "publicPath" option: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
104104

105105
exports[`"outputPath" option should work with "String" value and with "publicPath" option: warnings 1`] = `Array []`;
106106

107107
exports[`"outputPath" option should work with "String" value without trailing slash: assets 1`] = `
108108
Array [
109-
"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
109+
"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png",
110110
"main.bundle.js",
111111
]
112112
`;
113113

114114
exports[`"outputPath" option should work with "String" value without trailing slash: errors 1`] = `Array []`;
115115

116-
exports[`"outputPath" option should work with "String" value without trailing slash: result 1`] = `"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
116+
exports[`"outputPath" option should work with "String" value without trailing slash: result 1`] = `"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
117117

118118
exports[`"outputPath" option should work with "String" value without trailing slash: warnings 1`] = `Array []`;
119119

120120
exports[`"outputPath" option should work with "String" value: assets 1`] = `
121121
Array [
122-
"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
122+
"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png",
123123
"main.bundle.js",
124124
]
125125
`;
126126

127127
exports[`"outputPath" option should work with "String" value: errors 1`] = `Array []`;
128128

129-
exports[`"outputPath" option should work with "String" value: result 1`] = `"output_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
129+
exports[`"outputPath" option should work with "String" value: result 1`] = `"output_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
130130

131131
exports[`"outputPath" option should work with "String" value: warnings 1`] = `Array []`;
132132

133133
exports[`"outputPath" option should work without value: assets 1`] = `
134134
Array [
135-
"9c87cbf3ba33126ffd25ae7f2f6bbafb.png",
135+
"39f5c21c1aee6ff21844c6e1d8251d97.png",
136136
"main.bundle.js",
137137
]
138138
`;
139139

140140
exports[`"outputPath" option should work without value: errors 1`] = `Array []`;
141141

142-
exports[`"outputPath" option should work without value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
142+
exports[`"outputPath" option should work without value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
143143

144144
exports[`"outputPath" option should work without value: warnings 1`] = `Array []`;

‎test/__snapshots__/postTransformPublicPath-option.test.js.snap

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,54 @@
22

33
exports[`"postTransformPublicPath" option should work with "Function" and "publicPath" option as "Function": errors 1`] = `Array []`;
44

5-
exports[`"postTransformPublicPath" option should work with "Function" and "publicPath" option as "Function": result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
5+
exports[`"postTransformPublicPath" option should work with "Function" and "publicPath" option as "Function": result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
66

77
exports[`"postTransformPublicPath" option should work with "Function" and "publicPath" option as "Function": warnings 1`] = `Array []`;
88

99
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and "publicPath" option as "Function": errors 1`] = `Array []`;
1010

11-
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and "publicPath" option as "Function": result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png?test=test"`;
11+
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and "publicPath" option as "Function": result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png?test=test"`;
1212

1313
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and "publicPath" option as "Function": warnings 1`] = `Array []`;
1414

1515
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and use "publicPath" option: errors 1`] = `Array []`;
1616

17-
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and use "publicPath" option: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png?test=test"`;
17+
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and use "publicPath" option: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png?test=test"`;
1818

1919
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value and use "publicPath" option: warnings 1`] = `Array []`;
2020

2121
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value: errors 1`] = `Array []`;
2222

23-
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png/test"`;
23+
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png/test"`;
2424

2525
exports[`"postTransformPublicPath" option should work with "Function" where append to input parameter value: warnings 1`] = `Array []`;
2626

2727
exports[`"postTransformPublicPath" option should work with "Function" where prepend "__webpack_public_path__" and "publicPath" option as "String": errors 1`] = `Array []`;
2828

29-
exports[`"postTransformPublicPath" option should work with "Function" where prepend "__webpack_public_path__" and "publicPath" option as "String": result 1`] = `"http://code.com/public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
29+
exports[`"postTransformPublicPath" option should work with "Function" where prepend "__webpack_public_path__" and "publicPath" option as "String": result 1`] = `"http://code.com/public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
3030

3131
exports[`"postTransformPublicPath" option should work with "Function" where prepend "__webpack_public_path__" and "publicPath" option as "String": warnings 1`] = `Array []`;
3232

3333
exports[`"postTransformPublicPath" option should work with "Function" where prepend path and "publicPath" option as "String": errors 1`] = `Array []`;
3434

35-
exports[`"postTransformPublicPath" option should work with "Function" where prepend path and "publicPath" option as "String": result 1`] = `"path_prefix/public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
35+
exports[`"postTransformPublicPath" option should work with "Function" where prepend path and "publicPath" option as "String": result 1`] = `"path_prefix/public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
3636

3737
exports[`"postTransformPublicPath" option should work with "Function" where prepend path and "publicPath" option as "String": warnings 1`] = `Array []`;
3838

3939
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification and use "publicPath" option: errors 1`] = `Array []`;
4040

41-
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification and use "publicPath" option: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
41+
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification and use "publicPath" option: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
4242

4343
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification and use "publicPath" option: warnings 1`] = `Array []`;
4444

4545
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification: errors 1`] = `Array []`;
4646

47-
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
47+
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
4848

4949
exports[`"postTransformPublicPath" option should work with "Function" where return input parameter value without modification: warnings 1`] = `Array []`;
5050

5151
exports[`"postTransformPublicPath" option should work without value: errors 1`] = `Array []`;
5252

53-
exports[`"postTransformPublicPath" option should work without value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
53+
exports[`"postTransformPublicPath" option should work without value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
5454

5555
exports[`"postTransformPublicPath" option should work without value: warnings 1`] = `Array []`;

‎test/__snapshots__/publicPath-option.test.js.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22

33
exports[`"publicPath" option should work with "Function" value and pass "url", "resourcePath" and "context" as arguments: errors 1`] = `Array []`;
44

5-
exports[`"publicPath" option should work with "Function" value and pass "url", "resourcePath" and "context" as arguments: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
5+
exports[`"publicPath" option should work with "Function" value and pass "url", "resourcePath" and "context" as arguments: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
66

77
exports[`"publicPath" option should work with "Function" value and pass "url", "resourcePath" and "context" as arguments: warnings 1`] = `Array []`;
88

99
exports[`"publicPath" option should work with "String" value equal an URL: errors 1`] = `Array []`;
1010

11-
exports[`"publicPath" option should work with "String" value equal an URL: result 1`] = `"https://cdn.com/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
11+
exports[`"publicPath" option should work with "String" value equal an URL: result 1`] = `"https://cdn.com/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
1212

1313
exports[`"publicPath" option should work with "String" value equal an URL: warnings 1`] = `Array []`;
1414

1515
exports[`"publicPath" option should work with "String" value without trailing slash: errors 1`] = `Array []`;
1616

17-
exports[`"publicPath" option should work with "String" value without trailing slash: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
17+
exports[`"publicPath" option should work with "String" value without trailing slash: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
1818

1919
exports[`"publicPath" option should work with "String" value without trailing slash: warnings 1`] = `Array []`;
2020

2121
exports[`"publicPath" option should work with "String" value: errors 1`] = `Array []`;
2222

23-
exports[`"publicPath" option should work with "String" value: result 1`] = `"public_path/9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
23+
exports[`"publicPath" option should work with "String" value: result 1`] = `"public_path/39f5c21c1aee6ff21844c6e1d8251d97.png"`;
2424

2525
exports[`"publicPath" option should work with "String" value: warnings 1`] = `Array []`;
2626

2727
exports[`"publicPath" option should work without value: errors 1`] = `Array []`;
2828

29-
exports[`"publicPath" option should work without value: result 1`] = `"9c87cbf3ba33126ffd25ae7f2f6bbafb.png"`;
29+
exports[`"publicPath" option should work without value: result 1`] = `"39f5c21c1aee6ff21844c6e1d8251d97.png"`;
3030

3131
exports[`"publicPath" option should work without value: warnings 1`] = `Array []`;

‎test/outputPath-option.test.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ describe('"outputPath" option', () => {
7171
});
7272

7373
it('should work with "Function" value', async () => {
74-
// TODO
74+
expect.assertions(7);
75+
7576
const compiler = getCompiler('simple.js', {
7677
outputPath(url, resourcePath, context) {
77-
expect(url).toBe('9c87cbf3ba33126ffd25ae7f2f6bbafb.png');
78-
expect(resourcePath).toMatch('file.png');
79-
expect(context).toMatch('fixtures');
78+
expect(typeof url).toBe('string');
79+
expect(typeof resourcePath).toBe('string');
80+
expect(typeof context).toBe('string');
8081

8182
return `output_path_func/${url}`;
8283
},

‎test/publicPath-option.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ describe('"publicPath" option', () => {
7070

7171
const compiler = getCompiler('simple.js', {
7272
publicPath(url, resourcePath, context) {
73-
expect(url).toMatch('9c87cbf3ba33126ffd25ae7f2f6bbafb.png');
74-
expect(resourcePath).toMatch('file.png');
75-
expect(context).toMatch('fixtures');
73+
expect(typeof url).toBe('string');
74+
expect(typeof resourcePath).toBe('string');
75+
expect(typeof context).toBe('string');
7676

7777
return `public_path/${url}`;
7878
},

0 commit comments

Comments
 (0)
This repository has been archived.