var Worker = require ( "worker!./worker" ) ;
var worker = new Worker ;
worker . postMessage ( "b" ) ;
worker . onmessage = function ( event ) {
var templateB = event . data ; // "This text was generated by template B"
}
onmessage = function ( event ) {
var template = event . data ;
require ( [ "../require.context/templates/" + event . data ] , function ( tmpl ) {
postMessage ( tmpl ( ) ) ;
} ) ;
}
/******/ ( function ( modules ) {
/******/ var installedModules = { } ;
/******/ function require ( moduleId ) {
/******/ if ( typeof moduleId !== "number" ) throw new Error ( "Cannot find module '" + moduleId + "'" ) ;
/******/ if ( installedModules [ moduleId ] )
/******/ return installedModules [ moduleId ] . exports ;
/******/ var module = installedModules [ moduleId ] = {
/******/ exports : { } ,
/******/ id : moduleId ,
/******/ loaded : false
/******/ } ;
/******/ modules [ moduleId ] ( module , module . exports , require ) ;
/******/ module . loaded = true ;
/******/ return module . exports ;
/******/ }
/******/ require . e = function ( chunkId , callback ) {
/******/ callback ( require ) ;
/******/ } ;
/******/ require . modules = modules ;
/******/ require . cache = installedModules ;
/******/ return require ( 0 ) ;
/******/ } )
/******/ ( { c :"" ,
/******/ 0 : function ( module , exports , require ) {
/**! .\example.js !**/
var Worker = require ( /*! worker!./worker */ 1 ) ;
var worker = new Worker ;
worker . postMessage ( "b" ) ;
worker . onmessage = function ( event ) {
var templateB = event . data ; // "This text was generated by template B"
}
/******/ } ,
/******/
/******/ 1 : function ( module , exports , require ) {
/**! (webpack)\~\worker-loader!.\worker.js !**/
module . exports = function ( ) {
return new Worker ( ( require . modules . c || '' ) + "hash.worker.js" ) ;
}
/******/ }
/******/ } )
/******/ ( function ( modules ) {
/******/ var installedModules = { } , installedChunks = { 0 :1 } ;
/******/ function require ( moduleId ) {
/******/ if ( typeof moduleId !== "number" ) throw new Error ( "Cannot find module '" + moduleId + "'" ) ;
/******/ if ( installedModules [ moduleId ] )
/******/ return installedModules [ moduleId ] . exports ;
/******/ var module = installedModules [ moduleId ] = {
/******/ exports : { } ,
/******/ id : moduleId ,
/******/ loaded : false
/******/ } ;
/******/ modules [ moduleId ] ( module , module . exports , require ) ;
/******/ module . loaded = true ;
/******/ return module . exports ;
/******/ }
/******/ require . e = function ( chunkId , callback ) {
/******/ if ( installedChunks [ chunkId ] === 1 ) return callback ( require ) ;
/******/ importScripts ( chunkId + modules . a ) ;
/******/ callback ( require ) ;
/******/ } ;
/******/ require . modules = modules ;
/******/ require . cache = installedModules ;
/******/ this [ modules . b ] = function ( chunkId , moreModules ) {
/******/ for ( var moduleId in moreModules )
/******/ modules [ moduleId ] = moreModules [ moduleId ] ;
/******/ installedChunks [ chunkId ] = 1 ;
/******/ } ;
/******/ return require ( 0 ) ;
/******/ } )
/******/ ( { a :".hash.worker.js" , b :"webpackJsonp" , c :"" ,
/******/ 0 : function ( module , exports , require ) {
/**! .\worker.js !**/
/******/ /* WEBPACK FREE VAR INJECTION */ ( function ( require ) {
onmessage = function ( event ) {
var template = event . data ;
require ( 1 , function ( ) { return [ require ( /*! ../require.context/templates */ 3 ) ( "./" + event . data ) ] } , function ( tmpl ) {
postMessage ( tmpl ( ) ) ;
} ) ;
}
/******/ /* WEBPACK FREE VAR INJECTION */ } ( require ( /*! __webpack_amd_require */ 1 ) ) )
/******/ } ,
/******/
/******/ 1 : function ( module , exports , require ) {
/**! (webpack)\buildin\__webpack_amd_require.js !**/
var req = require . valueOf ( ) ;
function amdRequire ( chunk , requiresFn , fn ) {
if ( ! requiresFn ) {
// commonjs
return req ( chunk ) ;
}
req . e ( chunk , function ( ) {
var modules = requiresFn ( ) ;
if ( fn )
return fn . apply ( null , modules ) ;
} ) ;
}
for ( var name in req )
amdRequire [ name ] = req [ name ] ;
amdRequire . amd = require ( /*! ./__webpack_options_amd.loader.js!./__webpack_options_amd.loader.js */ 2 ) ;
amdRequire . config = function ( ) { /* config is ignored, use webpack options */ } ;
module . exports = amdRequire ;
/******/ } ,
/******/
/******/ 2 : function ( module , exports , require ) {
/**! (webpack)\buildin\__webpack_options_amd.loader.js!(webpack)\buildin\__webpack_options_amd.loader.js !**/
/* empty to return {} */
/******/ }
/******/ } )
Hash: a017658b60f538eb1b15676e358061da
Compile Time: 70ms
Chunks: 1
Modules: 2
Modules including duplicates: 2
Modules first chunk: 2
main output.js: 1318 chars/bytes
1.hash.worker.js: 1110 chars/bytes
hash.worker.js: 2496 chars/bytes
<id> <size> <filename>
<reason> from <filename>
output.js
0 207 .\example.js
main
1 96 (webpack)\~\worker-loader!.\worker.js
require (1x) from .\example.js
Embedded Stats
.\worker.js
Hash: 5287351eed0ecaf472b73b4bca2c6807
Compile Time: 28ms
Chunks: 2
Modules: 7
Modules including duplicates: 7
Modules first chunk: 3
<id> <size> <filename>
<reason> from <filename>
hash.worker.js
0 206 .\worker.js
main
1 502 (webpack)\buildin\__webpack_amd_require.js
require (1x) from .\worker.js
2 24 (webpack)\buildin\__webpack_options_amd.loader.js!(webpack)\buildin\__webpack_options_amd.loader.js
require (1x) from (webpack)\buildin\__webpack_amd_require.js
1.hash.worker.js
3 322 [context] (webpack)\examples\require.context\templates
async context from .\worker.js
4 80 (webpack)\examples\require.context\templates\a.js
async context from .\worker.js
5 80 (webpack)\examples\require.context\templates\b.js
async context from .\worker.js
6 80 (webpack)\examples\require.context\templates\c.js
async context from .\worker.js
Minimized (uglify-js, no zip)
Hash: b00ed9ef0ffbad2cdb698fc88413d6c7
Compile Time: 310ms
Chunks: 1
Modules: 2
Modules including duplicates: 2
Modules first chunk: 2
main output.js: 468 chars/bytes
1.hash.worker.js: 456 chars/bytes
hash.worker.js: 804 chars/bytes
<id> <size> <filename>
<reason> from <filename>
output.js
0 101 .\example.js
main
1 87 (webpack)\~\worker-loader!.\worker.js
require (1x) from .\example.js
Embedded Stats
.\worker.js
Hash: 59734387e963771414968c9e4f9bcbeb
Compile Time: 233ms
Chunks: 2
Modules: 7
Modules including duplicates: 7
Modules first chunk: 3
<id> <size> <filename>
<reason> from <filename>
hash.worker.js
0 115 .\worker.js
main
1 271 (webpack)\buildin\__webpack_amd_require.js
require (1x) from .\worker.js
2 0 (webpack)\buildin\__webpack_options_amd.loader.js!(webpack)\buildin\__webpack_options_amd.loader.js
require (1x) from (webpack)\buildin\__webpack_amd_require.js
1.hash.worker.js
3 213 [context] (webpack)\examples\require.context\templates
async context from .\worker.js
4 73 (webpack)\examples\require.context\templates\a.js
async context from .\worker.js
5 73 (webpack)\examples\require.context\templates\b.js
async context from .\worker.js
6 73 (webpack)\examples\require.context\templates\c.js
async context from .\worker.js