Skip to content

Commit 6b0c20a

Browse files
authored
Merge pull request webpack#2628 from mnpenner/master
Removed `sourcePrefix` option -- fixes https://github.com/webpack/web…
2 parents 314c897 + c867a4f commit 6b0c20a

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

lib/FunctionModuleTemplatePlugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ FunctionModuleTemplatePlugin.prototype.apply = function(moduleTemplate) {
1616
defaultArguments.push("__webpack_require__");
1717
}
1818
source.add("/***/ function(" + defaultArguments.concat(module.arguments || []).join(", ") + ") {\n\n");
19-
if(module.strict) source.add(this.outputOptions.sourcePrefix + "\"use strict\";\n");
20-
source.add(new PrefixSource(this.outputOptions.sourcePrefix, moduleSource));
19+
if(module.strict) source.add("\"use strict\";\n");
20+
source.add(moduleSource);
2121
source.add("\n\n/***/ }");
2222
return source;
2323
});

lib/WebpackOptionsDefaulter.js

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ function WebpackOptionsDefaulter() {
5858
this.set("output.hashFunction", "md5");
5959
this.set("output.hashDigest", "hex");
6060
this.set("output.hashDigestLength", 20);
61-
this.set("output.sourcePrefix", "\t");
6261
this.set("output.devtoolLineToLine", false);
6362

6463
this.set("node", {});

test/statsCases/chunks/expected.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Hash: 55b4e00b04fd0c502b1f
22
Time: Xms
33
Asset Size Chunks Chunk Names
44
bundle.js 5.29 kB 0 [emitted] main
5-
1.bundle.js 252 bytes 1 [emitted]
6-
2.bundle.js 107 bytes 2 [emitted]
7-
3.bundle.js 202 bytes 3 [emitted]
5+
1.bundle.js 251 bytes 1 [emitted]
6+
2.bundle.js 106 bytes 2 [emitted]
7+
3.bundle.js 200 bytes 3 [emitted]
88
chunk {0} bundle.js (main) 73 bytes [rendered]
99
> main [5] (webpack)/test/statsCases/chunks/index.js
1010
[0] (webpack)/test/statsCases/chunks/a.js 22 bytes {0} [built]

test/statsCases/optimize-chunks/expected.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Hash: e3dc693bc52a75b4a39b
22
Time: Xms
33
Asset Size Chunks Chunk Names
4-
0.js 245 bytes 0 [emitted] cir1
5-
1.js 215 bytes 1, 2 [emitted] abd
6-
2.js 131 bytes 2 [emitted] ab
7-
main.js 6.03 kB 3 [emitted] main
8-
4.js 260 bytes 4 [emitted] cir2
9-
5.js 138 bytes 5, 7 [emitted] chunk
10-
6.js 319 bytes 6, 4 [emitted] cir2 from cir1
11-
7.js 79 bytes 7 [emitted] ac in ab
4+
0.js 244 bytes 0 [emitted] cir1
5+
1.js 212 bytes 1, 2 [emitted] abd
6+
2.js 129 bytes 2 [emitted] ab
7+
main.js 6.01 kB 3 [emitted] main
8+
4.js 259 bytes 4 [emitted] cir2
9+
5.js 136 bytes 5, 7 [emitted] chunk
10+
6.js 317 bytes 6, 4 [emitted] cir2 from cir1
11+
7.js 78 bytes 7 [emitted] ac in ab
1212
chunk {0} 0.js (cir1) 81 bytes {3} {6} {4} [rendered]
1313
> cir1 [7] (webpack)/test/statsCases/optimize-chunks/index.js 13:0-54
1414
> duplicate cir1 from cir2 [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 1:0-79

test/statsCases/preset-verbose/expected.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Hash: 8ca45b6d16d1f1e8be32
22
Time: Xms
33
Asset Size Chunks Chunk Names
44
main.js 5.28 kB 0 [emitted] main
5-
1.js 252 bytes 1 [emitted]
6-
2.js 107 bytes 2 [emitted]
7-
3.js 202 bytes 3 [emitted]
5+
1.js 251 bytes 1 [emitted]
6+
2.js 106 bytes 2 [emitted]
7+
3.js 200 bytes 3 [emitted]
88
chunk {0} main.js (main) 73 bytes [rendered]
99
[0] (webpack)/test/statsCases/preset-verbose/a.js 22 bytes {0} [built]
1010
cjs require ./a [5] (webpack)/test/statsCases/preset-verbose/index.js 1:0-14

0 commit comments

Comments
 (0)