formating and comments for the main template
This commit is contained in:
parent
86ca373134
commit
e461d217db
|
@ -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
|
||||
|
|
|
@ -17,78 +17,83 @@ module.exports = "It works";
|
|||
|
||||
``` 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);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -158,10 +163,10 @@ module.exports = "It works";
|
|||
|
||||
```
|
||||
Hash: d75e46ac811b482356205a47ab1dc1c0
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 67ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 71ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 3109 0 main
|
||||
output.js 3332 0 main
|
||||
1.output.js 184 1
|
||||
chunk {0} output.js (main) 486
|
||||
[0] ./example.js 88 [built] {0}
|
||||
|
@ -176,8 +181,8 @@ chunk {1} 1.output.js 28 {0}
|
|||
|
||||
```
|
||||
Hash: d75e46ac811b482356205a47ab1dc1c0
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 155ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 156ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 853 0 main
|
||||
1.output.js 56 1
|
||||
|
|
|
@ -14,78 +14,83 @@ require.ensure(["c"], function(require) {
|
|||
|
||||
``` 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);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -171,10 +176,10 @@ webpackJsonp([1],{3:function(){},4:function(){}});
|
|||
|
||||
```
|
||||
Hash: 5543ff7619209e2d2e8aeebc12be7462
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 42ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 44ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 2844 0 main
|
||||
output.js 3067 0 main
|
||||
1.output.js 305 1
|
||||
chunk {0} output.js (main) 166
|
||||
[0] ./example.js 144 [built] {0}
|
||||
|
@ -194,8 +199,8 @@ chunk {1} 1.output.js 22 {0}
|
|||
|
||||
```
|
||||
Hash: 5543ff7619209e2d2e8aeebc12be7462
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 135ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 133ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 744 0 main
|
||||
1.output.js 50 1
|
||||
|
|
|
@ -27,41 +27,47 @@ module.exports = 42
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -115,10 +121,10 @@ module.exports = {
|
|||
|
||||
```
|
||||
Hash: 5394516f6bbce8cc020e6c170fd62636
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 172ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 178ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1601 0 main
|
||||
output.js 1818 0 main
|
||||
chunk {0} output.js (main) 206
|
||||
[0] ./example.js 31 [built] {0}
|
||||
[1] ./cup2.coffee 57 [built] {0}
|
||||
|
@ -132,8 +138,8 @@ chunk {0} output.js (main) 206
|
|||
|
||||
```
|
||||
Hash: 5394516f6bbce8cc020e6c170fd62636
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 228ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 231ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 418 0 main
|
||||
chunk {0} output.js (main) 206
|
||||
|
|
|
@ -32,41 +32,47 @@ exports.add = function() {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -122,10 +128,10 @@ exports.add = function() {
|
|||
|
||||
```
|
||||
Hash: b3372208595e483f54eaa29577bc99f8
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 33ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 35ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1708 0 main
|
||||
output.js 1925 0 main
|
||||
chunk {0} output.js (main) 329
|
||||
[0] ./example.js 69 [built] {0}
|
||||
[1] ./increment.js 98 [built] {0}
|
||||
|
@ -138,8 +144,8 @@ chunk {0} output.js (main) 329
|
|||
|
||||
```
|
||||
Hash: b3372208595e483f54eaa29577bc99f8
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 96ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 95ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 460 0 main
|
||||
chunk {0} output.js (main) 329
|
||||
|
|
|
@ -73,41 +73,47 @@ module.exports = {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -250,10 +256,10 @@ module.exports = "B";
|
|||
|
||||
```
|
||||
Hash: 90defdf491ebab80d48bd42ea1f7c17d
|
||||
Version: webpack 0.10.0-beta1
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 124ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 6167 0 main
|
||||
output.js 6384 0 main
|
||||
chunk {0} output.js (main) 1981
|
||||
[0] ./example.js 111 [built] {0}
|
||||
[1] ./component/webpack-a-component (component) 328 [built] {0}
|
||||
|
@ -283,8 +289,8 @@ chunk {0} output.js (main) 1981
|
|||
|
||||
```
|
||||
Hash: 347d579347a144b45a78b34863b12b79
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 466ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 238ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1243 0 main
|
||||
chunk {0} output.js (main) 1960
|
||||
|
|
|
@ -34,41 +34,47 @@ module.exports = {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -94,10 +100,10 @@ console.log("Missing Text");
|
|||
|
||||
```
|
||||
Hash: a738ac89a403e736beace631044222a3
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 20ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 22ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1139 0 main
|
||||
output.js 1356 0 main
|
||||
chunk {0} output.js (main) 64
|
||||
[0] ./example.js 64 [built] {0}
|
||||
|
||||
|
@ -109,8 +115,8 @@ Missing localization: Missing Text
|
|||
|
||||
```
|
||||
Hash: a738ac89a403e736beace631044222a3
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 61ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 66ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 308 0 main
|
||||
chunk {0} output.js (main) 64
|
||||
|
|
|
@ -31,41 +31,47 @@ exports: function add() {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -123,10 +129,10 @@ The remaining labels are removed while minimizing.
|
|||
|
||||
```
|
||||
Hash: 7167162ed42199dd8fc82db2097674eb
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 35ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 36ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1876 0 main
|
||||
output.js 2093 0 main
|
||||
chunk {0} output.js (main) 299
|
||||
[0] ./example.js 55 [built] {0}
|
||||
[1] ./increment.js 83 [built] {0}
|
||||
|
@ -139,8 +145,8 @@ chunk {0} output.js (main) 299
|
|||
|
||||
```
|
||||
Hash: 7167162ed42199dd8fc82db2097674eb
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 96ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 95ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 468 0 main
|
||||
chunk {0} output.js (main) 299
|
||||
|
|
|
@ -35,41 +35,47 @@ module.exports = function(content) {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -132,10 +138,10 @@ Prints in node.js (`enhanced-require example.js`) and in browser:
|
|||
|
||||
```
|
||||
Hash: 5caaa03683d41f386ba25cd5e2812588
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 57ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 62ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1889 0 main
|
||||
output.js 2106 0 main
|
||||
chunk {0} output.js (main) 282
|
||||
[0] ./example.js 205 [built] {0}
|
||||
[1] (webpack)/~/json-loader!./test.json 36 [built] {0}
|
||||
|
|
|
@ -76,78 +76,83 @@ require(
|
|||
|
||||
``` 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);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -311,37 +316,37 @@ module.exports = function() {
|
|||
|
||||
```
|
||||
Hash: c742d10da02e7180be4429633fb7f3af
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 77ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 78ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 5100 0 main
|
||||
output.js 5323 0 main
|
||||
1.output.js 1546 1
|
||||
chunk {0} output.js (main) 1395
|
||||
[0] ./example.js 613 [built] {0}
|
||||
[1] ./amd.js 309 [built] {0}
|
||||
amd require ./amd [2] ./commonjs.js 5:0-11:1
|
||||
cjs require ./amd [2] ./commonjs.js 8:13-29
|
||||
cjs require ./amd [0] ./example.js 3:11-27
|
||||
amd require ./amd [0] ./example.js 7:0-14:1
|
||||
amd require ./amd [0] ./example.js 7:0-14:1
|
||||
amd require ./amd [3] ./labeled.js 5:0-11:1
|
||||
cjs require ./amd [3] ./labeled.js 9:13-29
|
||||
amd require ./amd [2] ./commonjs.js 5:0-11:1
|
||||
cjs require ./amd [2] ./commonjs.js 8:13-29
|
||||
[2] ./commonjs.js 234 [built] {0}
|
||||
cjs require ./commonjs [0] ./example.js 2:16-37
|
||||
amd require ./commonjs [0] ./example.js 7:0-14:1
|
||||
amd require ./commonjs [0] ./example.js 7:0-14:1
|
||||
amd require ./commonjs [1] ./amd.js 2:0-12:1
|
||||
cjs require ./commonjs [1] ./amd.js 7:18-39
|
||||
amd require ./commonjs [3] ./labeled.js 5:0-11:1
|
||||
cjs require ./commonjs [3] ./labeled.js 8:18-39
|
||||
cjs require ./commonjs [0] ./example.js 2:16-37
|
||||
amd require ./commonjs [0] ./example.js 7:0-14:1
|
||||
amd require ./commonjs [0] ./example.js 7:0-14:1
|
||||
[3] ./labeled.js 239 [built] {0}
|
||||
amd require ./labeled [2] ./commonjs.js 5:0-11:1
|
||||
cjs require ./labeled [2] ./commonjs.js 9:17-37
|
||||
amd require ./labeled [1] ./amd.js 2:0-12:1
|
||||
cjs require ./labeled [1] ./amd.js 8:17-37
|
||||
cjs require ./labeled [0] ./example.js 4:15-35
|
||||
labeled require ./labeled [0] ./example.js 17:0-21
|
||||
amd require ./labeled [0] ./example.js 7:0-14:1
|
||||
amd require ./labeled [2] ./commonjs.js 5:0-11:1
|
||||
cjs require ./labeled [2] ./commonjs.js 9:17-37
|
||||
chunk {1} 1.output.js 439 {0}
|
||||
[4] ../require.context/templates ^\.\/.*\.js$ 193 [built] {1}
|
||||
amd require context ../require.context/templates [0] ./example.js 7:0-14:1
|
||||
|
|
|
@ -28,78 +28,83 @@ require.ensure(["b"], function(require) {
|
|||
|
||||
``` 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);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -223,10 +228,10 @@ webpackJsonp([2],
|
|||
|
||||
```
|
||||
Hash: af380ab476cbefc91864027374dff3e9
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 59ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 61ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 3022 0 main
|
||||
output.js 3245 0 main
|
||||
1.output.js 448 1, 2 my own chuck
|
||||
my own chuck.js 448 1, 2 my own chuck
|
||||
2.output.js 305 2
|
||||
|
|
|
@ -26,41 +26,47 @@ module.exports = function() {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -154,10 +160,10 @@ module.exports = webpackContext;
|
|||
|
||||
```
|
||||
Hash: 6de61529e12c5c59a06afb519b285fc6
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 39ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 41ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 2586 0 main
|
||||
output.js 2803 0 main
|
||||
chunk {0} output.js (main) 613
|
||||
[0] ./example.js 150 [built] {0}
|
||||
[1] ./templates/a.js 82 [built] {0}
|
||||
|
@ -177,8 +183,8 @@ chunk {0} output.js (main) 613
|
|||
|
||||
```
|
||||
Hash: 6de61529e12c5c59a06afb519b285fc6
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 114ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 116ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 844 0 main
|
||||
chunk {0} output.js (main) 613
|
||||
|
|
|
@ -27,41 +27,47 @@ module.exports = Math.random();
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -108,24 +114,24 @@ module.exports = Math.random();
|
|||
|
||||
```
|
||||
Hash: f180ba3e87e5894643306820cbd115dc
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 32ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 33ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 1559 0 main
|
||||
output.js 1776 0 main
|
||||
chunk {0} output.js (main) 326
|
||||
[0] ./example.js 295 [built] {0}
|
||||
[1] ./a.js 31 [built] {0}
|
||||
require.resolve ./a.js [0] ./example.js 4:10-35
|
||||
cjs require ./a [0] ./example.js 1:8-22
|
||||
cjs require ./a [0] ./example.js 10:9-23
|
||||
require.resolve ./a.js [0] ./example.js 4:10-35
|
||||
```
|
||||
|
||||
## Minimized (uglify-js, no zip)
|
||||
|
||||
```
|
||||
Hash: f180ba3e87e5894643306820cbd115dc
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 81ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 83ms
|
||||
Asset Size Chunks Chunk Names
|
||||
output.js 387 0 main
|
||||
chunk {0} output.js (main) 326
|
||||
|
|
|
@ -26,41 +26,47 @@ onmessage = function(event) {
|
|||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
// This file contains only the entry chunk.
|
||||
// The chunk loading function for additional chunks
|
||||
require.e = function requireEnsure(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
|
||||
// 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(_, callback) {
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
|
@ -99,61 +105,38 @@ module.exports = function() {
|
|||
# js/[hash].worker.js
|
||||
|
||||
``` javascript
|
||||
(function(modules) { // webpackBootstrap
|
||||
// The module cache
|
||||
var installedModules = {};
|
||||
/******/ (function webpackBootstrap(modules) {
|
||||
/******/ var installedModules = {};
|
||||
/******/ function require(moduleId) {
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
/******/ modules[moduleId].call(null, module, module.exports, require);
|
||||
/******/ module.loaded = true;
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/ require.e = function requireEnsure(chunkId, callback) {
|
||||
/******/ if(installedChunks[chunkId] === 1) return callback.call(null, require);
|
||||
/******/ importScripts(""+chunkId+".hash.worker.js");
|
||||
/******/ callback.call(null, require);
|
||||
/******/ };
|
||||
/******/ require.modules = modules;
|
||||
/******/ require.cache = installedModules;
|
||||
/******/ var installedChunks = {0:1};
|
||||
/******/ this["webpackChunk"] = function webpackChunkCallback(chunkIds, moreModules) {
|
||||
/******/ for(var moduleId in moreModules)
|
||||
/******/ modules[moduleId] = moreModules[moduleId];
|
||||
/******/ for(var i = 0; i < chunkIds.length; i++)
|
||||
/******/ installedChunks[chunkIds[i]] = 1;
|
||||
/******/ };
|
||||
/******/ return require(0);
|
||||
/******/ })({
|
||||
/******/ c: "",
|
||||
|
||||
// object to store loaded chunks
|
||||
// "1" means "already loaded"
|
||||
var installedChunks = {0:1};
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
require.e = function requireEnsure(chunkId, callback) {
|
||||
// "1" is the signal for "already loaded"
|
||||
if(!installedChunks[chunkId]) {
|
||||
importScripts("" + chunkId + ".hash.worker.js");
|
||||
}
|
||||
callback.call(null, require);
|
||||
};
|
||||
require.modules = modules;
|
||||
require.cache = installedModules;
|
||||
this["webpackChunk"] = function webpackChunkCallback(chunkIds, moreModules) {
|
||||
for(var moduleId in moreModules)
|
||||
modules[moduleId] = moreModules[moduleId];
|
||||
while(chunkIds.length)
|
||||
installedChunks[chunkIds.pop()] = 1;
|
||||
};
|
||||
|
||||
// Load entry module and return exports
|
||||
return require(0);
|
||||
})
|
||||
/************************************************************************/
|
||||
({
|
||||
// __webpack_public_path__
|
||||
|
||||
c: "",
|
||||
/***/ 0:
|
||||
/*!*******************!*\
|
||||
!*** ./worker.js ***!
|
||||
|
@ -169,14 +152,14 @@ onmessage = function(event) {
|
|||
|
||||
|
||||
/***/ }
|
||||
})
|
||||
/******/ })
|
||||
|
||||
```
|
||||
|
||||
# js/1.[hash].worker.hs
|
||||
|
||||
``` javascript
|
||||
webpackChunk([1],
|
||||
{
|
||||
webpackChunk([1], {
|
||||
|
||||
/***/ 1:
|
||||
/*!*********************************************!*\
|
||||
|
@ -243,8 +226,7 @@ module.exports = function() {
|
|||
|
||||
/***/ }
|
||||
|
||||
}
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
# Info
|
||||
|
@ -253,22 +235,22 @@ module.exports = function() {
|
|||
|
||||
```
|
||||
Hash: b898016580f5af04be201a389d5bc652
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 82ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 93ms
|
||||
Asset Size Chunks Chunk Names
|
||||
hash.worker.js 1842
|
||||
1.hash.worker.js 1567
|
||||
output.js 1727 0 main
|
||||
hash.worker.js 1715
|
||||
1.hash.worker.js 1566
|
||||
output.js 1944 0 main
|
||||
chunk {0} output.js (main) 302
|
||||
[0] ./example.js 206 [built] {0}
|
||||
[1] (webpack)/~/worker-loader!./worker.js 96 [not cacheable] [built] {0}
|
||||
cjs require worker!./worker [0] ./example.js 1:13-39
|
||||
Child worker:
|
||||
Hash: df2e39abee5b81accea763c727cac801
|
||||
Version: webpack 0.10.0-beta1
|
||||
Hash: d7a23ee9e23841a128556ef675f47aed
|
||||
Version: webpack 0.10.0-beta3
|
||||
Asset Size Chunks Chunk Names
|
||||
hash.worker.js 1842 0 main
|
||||
1.hash.worker.js 1567 1
|
||||
hash.worker.js 1715 0 main
|
||||
1.hash.worker.js 1566 1
|
||||
chunk {0} hash.worker.js (main) 168
|
||||
[0] ./worker.js 168 [built] {0}
|
||||
chunk {1} 1.hash.worker.js 463 {0}
|
||||
|
@ -289,10 +271,10 @@ Child worker:
|
|||
|
||||
```
|
||||
Hash: b898016580f5af04be201a389d5bc652
|
||||
Version: webpack 0.10.0-beta1
|
||||
Time: 226ms
|
||||
Version: webpack 0.10.0-beta3
|
||||
Time: 223ms
|
||||
Asset Size Chunks Chunk Names
|
||||
hash.worker.js 519
|
||||
hash.worker.js 566
|
||||
1.hash.worker.js 531
|
||||
output.js 418 0 main
|
||||
chunk {0} output.js (main) 302
|
||||
|
@ -300,10 +282,10 @@ chunk {0} output.js (main) 302
|
|||
[1] (webpack)/~/worker-loader!./worker.js 96 [not cacheable] [built] {0}
|
||||
cjs require worker!./worker [0] ./example.js 1:13-39
|
||||
Child worker:
|
||||
Hash: df2e39abee5b81accea763c727cac801
|
||||
Version: webpack 0.10.0-beta1
|
||||
Hash: d7a23ee9e23841a128556ef675f47aed
|
||||
Version: webpack 0.10.0-beta3
|
||||
Asset Size Chunks Chunk Names
|
||||
hash.worker.js 519 0 main
|
||||
hash.worker.js 566 0 main
|
||||
1.hash.worker.js 531 1
|
||||
chunk {0} hash.worker.js (main) 168
|
||||
[0] ./worker.js 168 [built] {0}
|
||||
|
|
|
@ -27,7 +27,7 @@ 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(buf.join("\n"), "webpackBootstrap " + hash);
|
||||
var bootstrapSource = new OriginalSource(this.indent(buf), "webpackBootstrap " + hash);
|
||||
var source = new ConcatSource("(function(modules) { // webpackBootstrap\n", bootstrapSource, "\n})\n");
|
||||
source.add("/************************************************************************/\n");
|
||||
source.add("({\n");
|
||||
|
@ -99,17 +99,24 @@ MainTemplate.prototype.renderRequireContent = function(hash, chunk) {
|
|||
MainTemplate.prototype.renderRequireExtensions = function(hash, chunk) {
|
||||
var buf = [];
|
||||
if(chunk.chunks.length == 0) {
|
||||
buf.push("// This file contains only the entry chunk.");
|
||||
buf.push("// The chunk loading function for additional chunks");
|
||||
buf.push(this.requireFn + ".e = function requireEnsure(_, callback) {");
|
||||
buf.push(this.indent([
|
||||
"callback.call(null, require);"
|
||||
]));
|
||||
buf.push("};");
|
||||
} else {
|
||||
buf.push("// The bundle contains no chunks. A empty chunk loading function.");
|
||||
buf.push(this.requireFn + ".e = function requireEnsure(chunkId, callback) {");
|
||||
buf.push(this.indent(this.renderRequireEnsure(hash, chunk)));
|
||||
buf.push("};");
|
||||
}
|
||||
buf.push("");
|
||||
buf.push("// expose the modules object (__webpack_modules__)");
|
||||
buf.push(this.requireFn + ".modules = modules;");
|
||||
buf.push("");
|
||||
buf.push("// expose the module cache");
|
||||
buf.push(this.requireFn + ".cache = installedModules;");
|
||||
return buf;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "webpack",
|
||||
"version": "0.10.0-beta2",
|
||||
"version": "0.10.0-beta3",
|
||||
"author": "Tobias Koppers @sokra",
|
||||
"description": "Packs CommonJs/AMD/Labeled Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue