Skip to content

Commit fea0c57

Browse files
committed
readd missing space
1 parent da5c8d8 commit fea0c57

File tree

17 files changed

+47
-36
lines changed

17 files changed

+47
-36
lines changed

lib/RuntimeTemplate.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ module.exports = class RuntimeTemplate {
2727
}
2828
if(!content) return "";
2929
if(this.outputOptions.pathinfo) {
30-
return Template.toComment(content);
30+
return Template.toComment(content) + " ";
3131
} else {
32-
return Template.toNormalComment(content);
32+
return Template.toNormalComment(content) + " ";
3333
}
3434
}
3535

@@ -258,7 +258,7 @@ module.exports = class RuntimeTemplate {
258258
const comment = this.comment({
259259
message
260260
});
261-
return `Promise.resolve(${comment})`;
261+
return `Promise.resolve(${comment.trim()})`;
262262
}
263263
const chunks = block.chunks.filter(chunk => !chunk.hasRuntime() && chunk.id !== null);
264264
const comment = this.comment({
@@ -271,9 +271,9 @@ module.exports = class RuntimeTemplate {
271271
return `__webpack_require__.e(${comment}${chunkId})`;
272272
} else if(chunks.length > 0) {
273273
const requireChunkId = chunk => `__webpack_require__.e(${JSON.stringify(chunk.id)})`;
274-
return `Promise.all(${comment}[${chunks.map(requireChunkId).join(", ")}])`;
274+
return `Promise.all(${comment.trim()}[${chunks.map(requireChunkId).join(", ")}])`;
275275
} else {
276-
return `Promise.resolve(${comment})`;
276+
return `Promise.resolve(${comment.trim()})`;
277277
}
278278
}
279279

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = function() {
2+
let str = "";
3+
let sum = ["1"];
4+
const query = +this.query.substr(1);
5+
for(let i = 0; i < query; i++) {
6+
str += `import b${i} from "./b?${Math.floor(i/2)}!";\n`;
7+
sum.push(`b${i}`);
8+
}
9+
str += "export default " + sum.join(" + ");
10+
return str;
11+
}

test/statsCases/chunks-development/expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Hash: 8f74408892465f3dc6d5
22
Time: Xms
33
Asset Size Chunks Chunk Names
4-
0.bundle.js 529 bytes 0 [emitted]
4+
0.bundle.js 530 bytes 0 [emitted]
55
1.bundle.js 394 bytes 1 [emitted]
6-
2.bundle.js 781 bytes 2 [emitted]
7-
bundle.js 7.54 KiB main [emitted] main
6+
2.bundle.js 782 bytes 2 [emitted]
7+
bundle.js 7.55 KiB main [emitted] main
88
chunk {main} bundle.js (main) 73 bytes [entry] [rendered]
99
> main [./index.js] ./index.js
1010
[./a.js] 22 bytes {main} [built]

test/statsCases/chunks/expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Hash: ee41f06ebdd1a9a95e6a
22
Time: Xms
33
Asset Size Chunks Chunk Names
44
0.bundle.js 152 bytes 0 [emitted]
5-
1.bundle.js 288 bytes 1 [emitted]
5+
1.bundle.js 289 bytes 1 [emitted]
66
2.bundle.js 227 bytes 2 [emitted]
7-
bundle.js 6.96 KiB 3 [emitted] main
7+
bundle.js 6.97 KiB 3 [emitted] main
88
chunk {0} 0.bundle.js 22 bytes {3} [rendered]
99
> [4] ./index.js 2:0-16
1010
[2] ./b.js 22 bytes {0} [built]

test/statsCases/commons-chunk-plugin-children/expected.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Child normal:
44
1.bundle.js 815 bytes 1 [emitted] x2
55
2.bundle.js 1.07 KiB 2 [emitted] x3
66
3.bundle.js 1.33 KiB 3 [emitted] x4
7-
4.bundle.js 864 bytes 4 [emitted] x5
7+
4.bundle.js 865 bytes 4 [emitted] x5
88
5.bundle.js 1.04 KiB 5 [emitted] xx5
9-
bundle.js 7.05 KiB 6 [emitted] main
9+
bundle.js 7.06 KiB 6 [emitted] main
1010
chunk {0} 0.bundle.js (x1) 14 bytes {6} [rendered]
1111
> x1 [11] ./index.js 1:0-42
1212
[0] ./a.js 0 bytes {0} {1} {2} {3} {4} [built]
@@ -49,9 +49,9 @@ Child children:
4949
1.bundle.js 661 bytes 1 [emitted] x2
5050
2.bundle.js 939 bytes 2 [emitted] x3
5151
3.bundle.js 1.19 KiB 3 [emitted] x4
52-
4.bundle.js 748 bytes 4 [emitted] x5
52+
4.bundle.js 749 bytes 4 [emitted] x5
5353
5.bundle.js 1.04 KiB 5 [emitted] xx5
54-
bundle.js 7.16 KiB 6 [emitted] main
54+
bundle.js 7.17 KiB 6 [emitted] main
5555
chunk {0} 0.bundle.js (x1) 14 bytes {6} [rendered]
5656
> x1 [11] ./index.js 1:0-42
5757
[6] ./x1.js 14 bytes {0} [built]
@@ -88,7 +88,7 @@ Child async:
8888
2.bundle.js 661 bytes 2 [emitted] x2
8989
3.bundle.js 939 bytes 3 [emitted] x3
9090
4.bundle.js 1.19 KiB 4 [emitted] x4
91-
5.bundle.js 748 bytes 5 [emitted] x5
91+
5.bundle.js 749 bytes 5 [emitted] x5
9292
6.bundle.js 1.04 KiB 6 [emitted] xx5
9393
bundle.js 7.25 KiB 7 [emitted] main
9494
chunk {0} 0.bundle.js 0 bytes {7} [rendered]
@@ -132,9 +132,9 @@ Child deep-children:
132132
1.bundle.js 661 bytes 1 [emitted] x2
133133
2.bundle.js 881 bytes 2 [emitted] x3
134134
3.bundle.js 1.13 KiB 3 [emitted] x4
135-
4.bundle.js 748 bytes 4 [emitted] x5
135+
4.bundle.js 749 bytes 4 [emitted] x5
136136
5.bundle.js 1020 bytes 5 [emitted] xx5
137-
bundle.js 7.28 KiB 6 [emitted] main
137+
bundle.js 7.29 KiB 6 [emitted] main
138138
chunk {0} 0.bundle.js (x1) 14 bytes {6} [rendered]
139139
> x1 [11] ./index.js 1:0-42
140140
[6] ./x1.js 14 bytes {0} [built]

test/statsCases/limit-chunk-count-plugin/expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Child
1515
Hash: f4bf5583ae34c4fb7657
1616
Time: Xms
1717
Asset Size Chunks Chunk Names
18-
0.bundle.js 926 bytes 0 [emitted]
18+
0.bundle.js 928 bytes 0 [emitted]
1919
bundle.js 7.12 KiB 1 [emitted] main
2020
chunk {0} 0.bundle.js 118 bytes {1} [rendered]
2121
[0] ./d.js 22 bytes {0} [built]
@@ -29,7 +29,7 @@ Child
2929
Hash: 31d10387e7bad2352849
3030
Time: Xms
3131
Asset Size Chunks Chunk Names
32-
0.bundle.js 788 bytes 0 [emitted]
32+
0.bundle.js 790 bytes 0 [emitted]
3333
1.bundle.js 245 bytes 1 [emitted]
3434
bundle.js 7.12 KiB 2 [emitted] main
3535
chunk {0} 0.bundle.js 74 bytes {2} [rendered]
@@ -47,7 +47,7 @@ Child
4747
Asset Size Chunks Chunk Names
4848
0.bundle.js 236 bytes 0 [emitted]
4949
1.bundle.js 245 bytes 1 [emitted]
50-
2.bundle.js 617 bytes 2 [emitted]
50+
2.bundle.js 619 bytes 2 [emitted]
5151
bundle.js 7.11 KiB 3 [emitted] main
5252
chunk {0} 0.bundle.js 44 bytes {2} {3} [rendered]
5353
[0] ./d.js 22 bytes {0} [built]

test/statsCases/module-deduplication-named/expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Asset Size Chunks Chunk Names
2-
0.js 817 bytes 0 [emitted] async3
3-
1.js 817 bytes 1 [emitted] async1
4-
2.js 817 bytes 2 [emitted] async2
2+
0.js 818 bytes 0 [emitted] async3
3+
1.js 818 bytes 1 [emitted] async1
4+
2.js 818 bytes 2 [emitted] async2
55
e1.js 7.94 KiB 3 [emitted] e1
66
e2.js 7.96 KiB 4 [emitted] e2
77
e3.js 7.98 KiB 5 [emitted] e3

test/statsCases/named-chunks-plugin-async/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Hash: 9ba7ce8e004fc375bd9e
22
Time: Xms
33
Asset Size Chunks Chunk Names
4-
chunk-containing-__a_js.js 464 bytes chunk-containing-__a_js [emitted]
4+
chunk-containing-__a_js.js 465 bytes chunk-containing-__a_js [emitted]
55
chunk-containing-__b_js.js 173 bytes chunk-containing-__b_js [emitted]
66
entry.js 7.13 KiB entry [emitted] entry
77
[0] ./modules/b.js 22 bytes {chunk-containing-__b_js} [built]

test/statsCases/optimize-chunks/expected.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Hash: 9e791589c2c0542190c6
22
Time: Xms
33
Asset Size Chunks Chunk Names
4-
0.js 298 bytes 0 [emitted] cir1
4+
0.js 299 bytes 0 [emitted] cir1
55
1.js 183 bytes 1 [emitted] ab
66
2.js 277 bytes 2, 1 [emitted] abd
7-
3.js 310 bytes 3 [emitted] cir2
7+
3.js 311 bytes 3 [emitted] cir2
88
4.js 190 bytes 4, 6 [emitted] chunk
9-
5.js 370 bytes 5, 3 [emitted] cir2 from cir1
9+
5.js 371 bytes 5, 3 [emitted] cir2 from cir1
1010
6.js 130 bytes 6 [emitted] ac in ab
11-
main.js 7.67 KiB 7 [emitted] main
11+
main.js 7.68 KiB 7 [emitted] main
1212
chunk {0} 0.js (cir1) 81 bytes {3} {7} [rendered]
1313
> duplicate cir1 from cir2 [3] ./circular2.js 1:0-79
1414
> duplicate cir1 [8] ./index.js 13:0-54

test/statsCases/performance-disabled/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Time: <CLR=BOLD>X</CLR>ms
22
<CLR=BOLD>Asset</CLR> <CLR=BOLD>Size</CLR> <CLR=BOLD>Chunks</CLR> <CLR=39,BOLD><CLR=22> <CLR=39,BOLD><CLR=22><CLR=BOLD>Chunk Names</CLR>
33
<CLR=32,BOLD>0.js</CLR> 152 bytes <CLR=BOLD>0</CLR> <CLR=32,BOLD>[emitted]</CLR>
4-
<CLR=32,BOLD>1.js</CLR> 288 bytes <CLR=BOLD>1</CLR> <CLR=32,BOLD>[emitted]</CLR>
4+
<CLR=32,BOLD>1.js</CLR> 289 bytes <CLR=BOLD>1</CLR> <CLR=32,BOLD>[emitted]</CLR>
55
<CLR=32,BOLD>2.js</CLR> 227 bytes <CLR=BOLD>2</CLR> <CLR=32,BOLD>[emitted]</CLR>
66
<CLR=32,BOLD>main.js</CLR> 300 KiB <CLR=BOLD>3</CLR> <CLR=32,BOLD>[emitted]</CLR> main
77
Entrypoint <CLR=BOLD>main</CLR> = <CLR=32,BOLD>main.js</CLR>

0 commit comments

Comments
 (0)