Permalink
Browse files

formating and comments for the main template

  • Loading branch information...
1 parent 86ca373 commit e461d217db9b0d44d65d456a5feb92996cef9e13 @sokra sokra committed Mar 27, 2013
@@ -18,78 +18,83 @@ getTemplate("b", function(b) {
``` javascript
(function(modules) { // webpackBootstrap
-// The module cache
-var installedModules = {};
-
-// object to store loaded and loading chunks
-// "0" means "already loaded"
-// Array means "loading", array contains callbacks
-var installedChunks = {0:0};
-
-// The require function
-function require(moduleId) {
- // Check if module is in cache
- if(installedModules[moduleId])
- return installedModules[moduleId].exports;
+ // The module cache
+ var installedModules = {};
- // Create a new module (and put it into the cache)
- var module = installedModules[moduleId] = {
- exports: {},
- id: moduleId,
- loaded: false
+ // object to store loaded and loading chunks
+ // "0" means "already loaded"
+ // Array means "loading", array contains callbacks
+ var installedChunks = {0:0};
+
+ // The require function
+ function require(moduleId) {
+ // Check if module is in cache
+ if(installedModules[moduleId])
+ return installedModules[moduleId].exports;
+
+ // Create a new module (and put it into the cache)
+ var module = installedModules[moduleId] = {
+ exports: {},
+ id: moduleId,
+ loaded: false
+ };
+
+ // Execute the module function
+ modules[moduleId].call(null, module, module.exports, require);
+
+ // Flag the module as loaded
+ module.loaded = true;
+
+ // Return the exports of the module
+ return module.exports;
+ }
+
+ // The bundle contains no chunks. A empty chunk loading function.
+ require.e = function requireEnsure(chunkId, callback) {
+ // "0" is the signal for "already loaded"
+ if(installedChunks[chunkId] === 0)
+ return callback.call(null, require);
+
+ // an array means "currently loading".
+ if(installedChunks[chunkId] !== undefined) {
+ installedChunks[chunkId].push(callback);
+ } else {
+ // start chunk loading
+ installedChunks[chunkId] = [callback];
+ var head = document.getElementsByTagName('head')[0];
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.charset = 'utf-8';
+ script.src = modules.c + "" + chunkId + ".output.js";
+ head.appendChild(script);
+ }
};
- // Execute the module function
- modules[moduleId].call(null, module, module.exports, require);
+ // expose the modules object (__webpack_modules__)
+ require.modules = modules;
- // Flag the module as loaded
- module.loaded = true;
+ // expose the module cache
+ require.cache = installedModules;
- // Return the exports of the module
- return module.exports;
-}
-
-require.e = function requireEnsure(chunkId, callback) {
- // "0" is the signal for "already loaded"
- if(installedChunks[chunkId] === 0)
- return callback.call(null, require);
+ // install a JSONP callback for chunk loading
+ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
+ // add "moreModules" to the modules object,
+ // then flag all "chunkIds" as loaded and fire callback
+ var moduleId, chunkId, callbacks = [];
+ while(chunkIds.length) {
+ chunkId = chunkIds.shift();
+ if(installedChunks[chunkId])
+ callbacks.push.apply(callbacks, installedChunks[chunkId]);
+ installedChunks[chunkId] = 0;
+ }
+ for(moduleId in moreModules)
+ modules[moduleId] = moreModules[moduleId];
+ while(callbacks.length)
+ callbacks.shift().call(null, require);
+ };
- // an array means "currently loading".
- if(installedChunks[chunkId] !== undefined) {
- installedChunks[chunkId].push(callback);
- } else {
- // start chunk loading
- installedChunks[chunkId] = [callback];
- var head = document.getElementsByTagName('head')[0];
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.charset = 'utf-8';
- script.src = modules.c + "" + chunkId + ".output.js";
- head.appendChild(script);
- }
-};
-require.modules = modules;
-require.cache = installedModules;
-
-// install a JSONP callback for chunk loading
-window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
- // add "moreModules" to the modules object,
- // then flag all "chunkIds" as loaded and fire callback
- var moduleId, chunkId, callbacks = [];
- while(chunkIds.length) {
- chunkId = chunkIds.shift();
- if(installedChunks[chunkId])
- callbacks.push.apply(callbacks, installedChunks[chunkId]);
- installedChunks[chunkId] = 0;
- }
- for(moduleId in moreModules)
- modules[moduleId] = moreModules[moduleId];
- while(callbacks.length)
- callbacks.shift().call(null, require);
-};
-
-// Load entry module and return exports
-return require(0);
+ // Load entry module and return exports
+ return require(0);
})
/************************************************************************/
({
@@ -199,10 +204,10 @@ module.exports = function() {
```
Hash: 7a6425e8fe46dc01a0db9eee1a97caca
-Version: webpack 0.10.0-beta1
-Time: 54ms
+Version: webpack 0.10.0-beta3
+Time: 56ms
Asset Size Chunks Chunk Names
- output.js 2793 0 main
+ output.js 3016 0 main
1.output.js 1567 1
chunk {0} output.js (main) 261
[0] ./example.js 261 [built] {0}
@@ -224,8 +229,8 @@ chunk {1} 1.output.js 463 {0}
```
Hash: 7a6425e8fe46dc01a0db9eee1a97caca
-Version: webpack 0.10.0-beta1
-Time: 185ms
+Version: webpack 0.10.0-beta3
+Time: 170ms
Asset Size Chunks Chunk Names
output.js 831 0 main
1.output.js 531 1
@@ -18,78 +18,83 @@ getTemplate("b", function(b) {
``` javascript
(function(modules) { // webpackBootstrap
-// The module cache
-var installedModules = {};
-
-// object to store loaded and loading chunks
-// "0" means "already loaded"
-// Array means "loading", array contains callbacks
-var installedChunks = {0:0};
-
-// The require function
-function require(moduleId) {
- // Check if module is in cache
- if(installedModules[moduleId])
- return installedModules[moduleId].exports;
+ // The module cache
+ var installedModules = {};
- // Create a new module (and put it into the cache)
- var module = installedModules[moduleId] = {
- exports: {},
- id: moduleId,
- loaded: false
+ // object to store loaded and loading chunks
+ // "0" means "already loaded"
+ // Array means "loading", array contains callbacks
+ var installedChunks = {0:0};
+
+ // The require function
+ function require(moduleId) {
+ // Check if module is in cache
+ if(installedModules[moduleId])
+ return installedModules[moduleId].exports;
+
+ // Create a new module (and put it into the cache)
+ var module = installedModules[moduleId] = {
+ exports: {},
+ id: moduleId,
+ loaded: false
+ };
+
+ // Execute the module function
+ modules[moduleId].call(null, module, module.exports, require);
+
+ // Flag the module as loaded
+ module.loaded = true;
+
+ // Return the exports of the module
+ return module.exports;
+ }
+
+ // The bundle contains no chunks. A empty chunk loading function.
+ require.e = function requireEnsure(chunkId, callback) {
+ // "0" is the signal for "already loaded"
+ if(installedChunks[chunkId] === 0)
+ return callback.call(null, require);
+
+ // an array means "currently loading".
+ if(installedChunks[chunkId] !== undefined) {
+ installedChunks[chunkId].push(callback);
+ } else {
+ // start chunk loading
+ installedChunks[chunkId] = [callback];
+ var head = document.getElementsByTagName('head')[0];
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.charset = 'utf-8';
+ script.src = modules.c + "" + chunkId + ".output.js";
+ head.appendChild(script);
+ }
};
- // Execute the module function
- modules[moduleId].call(null, module, module.exports, require);
+ // expose the modules object (__webpack_modules__)
+ require.modules = modules;
- // Flag the module as loaded
- module.loaded = true;
+ // expose the module cache
+ require.cache = installedModules;
- // Return the exports of the module
- return module.exports;
-}
-
-require.e = function requireEnsure(chunkId, callback) {
- // "0" is the signal for "already loaded"
- if(installedChunks[chunkId] === 0)
- return callback.call(null, require);
+ // install a JSONP callback for chunk loading
+ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
+ // add "moreModules" to the modules object,
+ // then flag all "chunkIds" as loaded and fire callback
+ var moduleId, chunkId, callbacks = [];
+ while(chunkIds.length) {
+ chunkId = chunkIds.shift();
+ if(installedChunks[chunkId])
+ callbacks.push.apply(callbacks, installedChunks[chunkId]);
+ installedChunks[chunkId] = 0;
+ }
+ for(moduleId in moreModules)
+ modules[moduleId] = moreModules[moduleId];
+ while(callbacks.length)
+ callbacks.shift().call(null, require);
+ };
- // an array means "currently loading".
- if(installedChunks[chunkId] !== undefined) {
- installedChunks[chunkId].push(callback);
- } else {
- // start chunk loading
- installedChunks[chunkId] = [callback];
- var head = document.getElementsByTagName('head')[0];
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.charset = 'utf-8';
- script.src = modules.c + "" + chunkId + ".output.js";
- head.appendChild(script);
- }
-};
-require.modules = modules;
-require.cache = installedModules;
-
-// install a JSONP callback for chunk loading
-window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
- // add "moreModules" to the modules object,
- // then flag all "chunkIds" as loaded and fire callback
- var moduleId, chunkId, callbacks = [];
- while(chunkIds.length) {
- chunkId = chunkIds.shift();
- if(installedChunks[chunkId])
- callbacks.push.apply(callbacks, installedChunks[chunkId]);
- installedChunks[chunkId] = 0;
- }
- for(moduleId in moreModules)
- modules[moduleId] = moreModules[moduleId];
- while(callbacks.length)
- callbacks.shift().call(null, require);
-};
-
-// Load entry module and return exports
-return require(0);
+ // Load entry module and return exports
+ return require(0);
})
/************************************************************************/
({
@@ -199,10 +204,10 @@ module.exports = function() {
```
Hash: bfc8a0c89870057a328ac4537518a669
-Version: webpack 0.10.0-beta1
-Time: 52ms
+Version: webpack 0.10.0-beta3
+Time: 55ms
Asset Size Chunks Chunk Names
- output.js 2681 0 main
+ output.js 2904 0 main
1.output.js 1567 1
chunk {0} output.js (main) 276
[0] ./example.js 276 [built] {0}
@@ -224,8 +229,8 @@ chunk {1} 1.output.js 463 {0}
```
Hash: bfc8a0c89870057a328ac4537518a669
-Version: webpack 0.10.0-beta1
-Time: 163ms
+Version: webpack 0.10.0-beta3
+Time: 168ms
Asset Size Chunks Chunk Names
output.js 792 0 main
1.output.js 531 1
Oops, something went wrong.

0 comments on commit e461d21

Please sign in to comment.