Skip to content

Commit

Permalink
Removed sourcePrefix option -- fixes webpack#166 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnpenner committed Jun 9, 2016
1 parent 314c897 commit c867a4f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/FunctionModuleTemplatePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ FunctionModuleTemplatePlugin.prototype.apply = function(moduleTemplate) {
defaultArguments.push("__webpack_require__");
}
source.add("/***/ function(" + defaultArguments.concat(module.arguments || []).join(", ") + ") {\n\n");
if(module.strict) source.add(this.outputOptions.sourcePrefix + "\"use strict\";\n");
source.add(new PrefixSource(this.outputOptions.sourcePrefix, moduleSource));
if(module.strict) source.add("\"use strict\";\n");
source.add(moduleSource);
source.add("\n\n/***/ }");
return source;
});
Expand Down
1 change: 0 additions & 1 deletion lib/WebpackOptionsDefaulter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function WebpackOptionsDefaulter() {
this.set("output.hashFunction", "md5");
this.set("output.hashDigest", "hex");
this.set("output.hashDigestLength", 20);
this.set("output.sourcePrefix", "\t");
this.set("output.devtoolLineToLine", false);

this.set("node", {});
Expand Down
6 changes: 3 additions & 3 deletions test/statsCases/chunks/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Hash: 55b4e00b04fd0c502b1f
Time: Xms
Asset Size Chunks Chunk Names
bundle.js 5.29 kB 0 [emitted] main
1.bundle.js 252 bytes 1 [emitted]
2.bundle.js 107 bytes 2 [emitted]
3.bundle.js 202 bytes 3 [emitted]
1.bundle.js 251 bytes 1 [emitted]
2.bundle.js 106 bytes 2 [emitted]
3.bundle.js 200 bytes 3 [emitted]
chunk {0} bundle.js (main) 73 bytes [rendered]
> main [5] (webpack)/test/statsCases/chunks/index.js
[0] (webpack)/test/statsCases/chunks/a.js 22 bytes {0} [built]
Expand Down
16 changes: 8 additions & 8 deletions test/statsCases/optimize-chunks/expected.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Hash: e3dc693bc52a75b4a39b
Time: Xms
Asset Size Chunks Chunk Names
0.js 245 bytes 0 [emitted] cir1
1.js 215 bytes 1, 2 [emitted] abd
2.js 131 bytes 2 [emitted] ab
main.js 6.03 kB 3 [emitted] main
4.js 260 bytes 4 [emitted] cir2
5.js 138 bytes 5, 7 [emitted] chunk
6.js 319 bytes 6, 4 [emitted] cir2 from cir1
7.js 79 bytes 7 [emitted] ac in ab
0.js 244 bytes 0 [emitted] cir1
1.js 212 bytes 1, 2 [emitted] abd
2.js 129 bytes 2 [emitted] ab
main.js 6.01 kB 3 [emitted] main
4.js 259 bytes 4 [emitted] cir2
5.js 136 bytes 5, 7 [emitted] chunk
6.js 317 bytes 6, 4 [emitted] cir2 from cir1
7.js 78 bytes 7 [emitted] ac in ab
chunk {0} 0.js (cir1) 81 bytes {3} {6} {4} [rendered]
> cir1 [7] (webpack)/test/statsCases/optimize-chunks/index.js 13:0-54
> duplicate cir1 from cir2 [3] (webpack)/test/statsCases/optimize-chunks/circular2.js 1:0-79
Expand Down
6 changes: 3 additions & 3 deletions test/statsCases/preset-verbose/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Hash: 8ca45b6d16d1f1e8be32
Time: Xms
Asset Size Chunks Chunk Names
main.js 5.28 kB 0 [emitted] main
1.js 252 bytes 1 [emitted]
2.js 107 bytes 2 [emitted]
3.js 202 bytes 3 [emitted]
1.js 251 bytes 1 [emitted]
2.js 106 bytes 2 [emitted]
3.js 200 bytes 3 [emitted]
chunk {0} main.js (main) 73 bytes [rendered]
[0] (webpack)/test/statsCases/preset-verbose/a.js 22 bytes {0} [built]
cjs require ./a [5] (webpack)/test/statsCases/preset-verbose/index.js 1:0-14
Expand Down

0 comments on commit c867a4f

Please sign in to comment.