Skip to content

Commit 9528aa5

Browse files
committed
fixup test and error
1 parent 34b6b13 commit 9528aa5

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

lib/dependencies/ImportParserPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ class CommentCompilationWarning extends WebpackError {
266266

267267
this.name = "CommentCompilationWarning";
268268

269-
this.origin = this.module = module;
270-
this.originLoc = loc;
269+
this.module = module;
270+
this.loc = loc;
271271

272272
Error.captureStackTrace(this, this.constructor);
273273
}

test/__snapshots__/StatsTestCases.test.js.snap

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,16 +1008,25 @@ Entrypoint entry = entry.js
10081008
`;
10091009

10101010
exports[`StatsTestCases should print correct stats for import-with-invalid-options-comments 1`] = `
1011-
" 6 modules
1012-
1013-
WARNING in ./chunk.js
1011+
"Built at: Thu Jan 01 1970 00:00:00 GMT
1012+
[0] ./chunk-a.js 27 bytes {2} [built]
1013+
[1] ./chunk-b.js 27 bytes {3} [built]
1014+
[2] ./chunk-c.js 27 bytes {4} [built]
1015+
[3] ./chunk-d.js 27 bytes {5} [built]
1016+
[4] ./chunk.js 401 bytes {0} [built] [3 warnings]
1017+
[5] ./index.js 50 bytes {1} [built]
1018+
1019+
WARNING in ./chunk.js 4:11-77
10141020
Compilation error while processing magic comment(-s): /* webpack Prefetch: 0, webpackChunkName: \\"notGoingToCompile-c\\" */: Unexpected identifier
1021+
@ ./index.js 1:0-49
10151022
1016-
WARNING in ./chunk.js
1023+
WARNING in ./chunk.js 5:11-38
10171024
Compilation error while processing magic comment(-s): /* webpackPrefetch: nope */: nope is not defined
1025+
@ ./index.js 1:0-49
10181026
1019-
WARNING in ./chunk.js
1020-
Compilation error while processing magic comment(-s): /* webpackPrefetch: true, webpackChunkName: notGoingToCompileChunkName */: notGoingToCompileChunkName is not defined"
1027+
WARNING in ./chunk.js 2:11-84
1028+
Compilation error while processing magic comment(-s): /* webpackPrefetch: true, webpackChunkName: notGoingToCompileChunkName */: notGoingToCompileChunkName is not defined
1029+
@ ./index.js 1:0-49"
10211030
`;
10221031

10231032
exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = `

test/statsCases/import-with-invalid-options-comments/webpack.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@ module.exports = {
44
output: {
55
chunkFilename: "[name].js"
66
},
7-
stats: "minimal"
7+
stats: {
8+
timings: false,
9+
hash: false,
10+
entrypoints: false,
11+
assets: false,
12+
errorDetails: true,
13+
moduleTrace: true
14+
}
815
};

0 commit comments

Comments
 (0)