Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get back old style

  • Loading branch information...
commit b5b5cc93722dc98eb3e7895297b2280d918ba277 1 parent 7679c75
@sokra sokra authored
Showing with 9 additions and 4 deletions.
  1. +2 −1  lib/FunctionModuleTemplate.js
  2. +7 −3 lib/MainTemplate.js
View
3  lib/FunctionModuleTemplate.js
@@ -3,6 +3,7 @@
Author Tobias Koppers @sokra
*/
var ConcatSource = require("webpack-core/lib/ConcatSource");
+var PrefixSource = require("webpack-core/lib/PrefixSource");
function FunctionModuleTemplate(outputOptions, requestShortener) {
this.outputOptions = outputOptions || {};
@@ -19,7 +20,7 @@ FunctionModuleTemplate.prototype.render = function(module, dependencyTemplates)
source.add(" \\****" + req.replace(/./g, "*") + "****/\n");
}
source.add("/***/ function(module, exports, require) {\n\n");
- source.add(module.source(dependencyTemplates, this.outputOptions, this.requestShortener));
+ source.add(new PrefixSource("\t", module.source(dependencyTemplates, this.outputOptions, this.requestShortener)));
source.add("\n\n/***/ }");
return source;
};
View
10 lib/MainTemplate.js
@@ -4,6 +4,7 @@
*/
var ConcatSource = require("webpack-core/lib/ConcatSource");
var OriginalSource = require("webpack-core/lib/OriginalSource");
+var PrefixSource = require("webpack-core/lib/PrefixSource");
var Template = require("./Template");
function MainTemplate(outputOptions) {
@@ -27,11 +28,14 @@ MainTemplate.prototype.render = function(hash, chunk, moduleTemplate, dependency
buf.push("");
buf.push("// Load entry module and return exports");
buf.push("return " + this.requireFn + "(0);");
- var bootstrapSource = new OriginalSource(this.indent(buf), "webpackBootstrap " + hash);
- var source = new ConcatSource("(function(modules) { // webpackBootstrap\n", bootstrapSource, "\n})\n");
+ var source = new ConcatSource();
+ source.add("/******/(function(modules) { // webpackBootstrap\n");
+ source.add(new PrefixSource("/******/\t", new OriginalSource(this.asString(buf), "webpackBootstrap " + hash)));
+ source.add("\n/******/})\n");
source.add("/************************************************************************/\n");
source.add("({\n");
source.add(this.asString(this.renderInitModules(hash, chunk, moduleTemplate, dependencyTemplates)));
+ source.add("\n");
chunk.modules.forEach(function(module, idx) {
if(idx != 0) source.add(",\n");
source.add("\n/***/ " + module.id + ":\n");
@@ -128,7 +132,7 @@ MainTemplate.prototype.renderInit = function(hash, chunk) {
MainTemplate.prototype.renderInitModules = function(hash, chunk, moduleTemplate, dependencyTemplates) {
var publicPath = this.outputOptions.publicPath || "";
return [
- "// __webpack_public_path__\n",
+ "// __webpack_public_path__",
"c: " + JSON.stringify(publicPath.replace(Template.REGEXP_HASH, hash)) + ","
];
};
Please sign in to comment.
Something went wrong with that request. Please try again.