|
| 1 | + |
| 2 | +# example.js |
| 3 | + |
| 4 | +``` javascript |
| 5 | +var a = require("./a"); |
| 6 | +var b = require("./b"); |
| 7 | +a.x !== b.x; |
| 8 | +a.y !== b.y; |
| 9 | +``` |
| 10 | + |
| 11 | +# a/index.js |
| 12 | + |
| 13 | +``` javascript |
| 14 | +module.exports = { |
| 15 | + x: require("./x"), |
| 16 | + y: require("./y"), |
| 17 | + z: require("../z") |
| 18 | +} |
| 19 | +``` |
| 20 | + |
| 21 | +# a/x.js |
| 22 | + |
| 23 | +``` javascript |
| 24 | +module.exports = {"this is": "x"}; |
| 25 | +``` |
| 26 | + |
| 27 | +# a/y.js |
| 28 | + |
| 29 | +``` javascript |
| 30 | +module.exports = {"this is": "y", "but in": "a"}; |
| 31 | +``` |
| 32 | + |
| 33 | +# b/index.js |
| 34 | + |
| 35 | +``` javascript |
| 36 | +module.exports = { |
| 37 | + x: require("./x"), |
| 38 | + y: require("./y"), |
| 39 | + z: require("../z") |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +# b/x.js |
| 44 | + |
| 45 | +``` javascript |
| 46 | +module.exports = {"this is": "x"}; |
| 47 | +``` |
| 48 | + |
| 49 | +# b/y.js |
| 50 | + |
| 51 | +``` javascript |
| 52 | +module.exports = {"this is": "y", "but in": "b"}; |
| 53 | +``` |
| 54 | + |
| 55 | +# z.js |
| 56 | + |
| 57 | +``` javascript |
| 58 | +module.exports = {"this is": "z"}; |
| 59 | +``` |
| 60 | + |
| 61 | +# js/output.js |
| 62 | + |
| 63 | +``` javascript |
| 64 | +/******/ (function(modules) { // webpackBootstrap |
| 65 | +/******/ // The module cache |
| 66 | +/******/ var installedModules = {}; |
| 67 | +/******/ |
| 68 | +/******/ // The require function |
| 69 | +/******/ function require(moduleId) { |
| 70 | +/******/ // Check if module is in cache |
| 71 | +/******/ if(installedModules[moduleId]) |
| 72 | +/******/ return installedModules[moduleId].exports; |
| 73 | +/******/ |
| 74 | +/******/ // Create a new module (and put it into the cache) |
| 75 | +/******/ var module = installedModules[moduleId] = { |
| 76 | +/******/ exports: {}, |
| 77 | +/******/ id: moduleId, |
| 78 | +/******/ loaded: false |
| 79 | +/******/ }; |
| 80 | +/******/ |
| 81 | +/******/ // Execute the module function |
| 82 | +/******/ modules[moduleId].call(null, module, module.exports, require); |
| 83 | +/******/ |
| 84 | +/******/ // Flag the module as loaded |
| 85 | +/******/ module.loaded = true; |
| 86 | +/******/ |
| 87 | +/******/ // Return the exports of the module |
| 88 | +/******/ return module.exports; |
| 89 | +/******/ } |
| 90 | +/******/ |
| 91 | +/******/ // The bundle contains no chunks. A empty chunk loading function. |
| 92 | +/******/ require.e = function requireEnsure(_, callback) { |
| 93 | +/******/ callback.call(null, require); |
| 94 | +/******/ }; |
| 95 | +/******/ |
| 96 | +/******/ // expose the modules object (__webpack_modules__) |
| 97 | +/******/ require.modules = modules; |
| 98 | +/******/ |
| 99 | +/******/ // expose the module cache |
| 100 | +/******/ require.cache = installedModules; |
| 101 | +/******/ |
| 102 | +/******/ |
| 103 | +/******/ // Load entry module and return exports |
| 104 | +/******/ return require(0); |
| 105 | +/******/ }) |
| 106 | +/************************************************************************/ |
| 107 | +/******/ ((function(modules) { |
| 108 | + for(var i in modules) { |
| 109 | + switch(typeof modules[i]) { |
| 110 | + case "number": |
| 111 | + modules[i] = modules[modules[i]]; |
| 112 | + break; |
| 113 | + case "object": |
| 114 | + modules[i] = (function(_m) { |
| 115 | + var args = _m.slice(1), fn = modules[_m[0]]; |
| 116 | + return function (a,b,c) { |
| 117 | + fn.apply(null, [a,b,c].concat(args)); |
| 118 | + }; |
| 119 | + }(modules[i])); |
| 120 | + } |
| 121 | + } |
| 122 | + return modules; |
| 123 | +}({ |
| 124 | +/******/ // __webpack_public_path__ |
| 125 | +/******/ c: "", |
| 126 | + |
| 127 | +/***/ 0: |
| 128 | +/*!********************!*\ |
| 129 | + !*** ./example.js ***! |
| 130 | + \********************/ |
| 131 | +/***/ function(module, exports, require) { |
| 132 | + |
| 133 | + var a = require(/*! ./a */ 2); |
| 134 | + var b = require(/*! ./b */ 5); |
| 135 | + a.x !== b.x; |
| 136 | + a.y !== b.y; |
| 137 | + |
| 138 | +/***/ }, |
| 139 | + |
| 140 | +/***/ 1: |
| 141 | +/*!**************!*\ |
| 142 | + !*** ./z.js ***! |
| 143 | + \**************/ |
| 144 | +/***/ function(module, exports, require) { |
| 145 | + |
| 146 | + module.exports = {"this is": "z"}; |
| 147 | + |
| 148 | +/***/ }, |
| 149 | + |
| 150 | +/***/ 2: |
| 151 | +[8, 3, 4], |
| 152 | + |
| 153 | +/***/ 3: |
| 154 | +/*!****************!*\ |
| 155 | + !*** ./a/x.js ***! |
| 156 | + \****************/ |
| 157 | +/***/ function(module, exports, require) { |
| 158 | + |
| 159 | + module.exports = {"this is": "x"}; |
| 160 | + |
| 161 | +/***/ }, |
| 162 | + |
| 163 | +/***/ 4: |
| 164 | +/*!****************!*\ |
| 165 | + !*** ./a/y.js ***! |
| 166 | + \****************/ |
| 167 | +/***/ function(module, exports, require) { |
| 168 | + |
| 169 | + module.exports = {"this is": "y", "but in": "a"}; |
| 170 | + |
| 171 | +/***/ }, |
| 172 | + |
| 173 | +/***/ 5: |
| 174 | +[8, 6, 7], |
| 175 | + |
| 176 | +/***/ 6: |
| 177 | +3, |
| 178 | + |
| 179 | +/***/ 7: |
| 180 | +/*!****************!*\ |
| 181 | + !*** ./b/y.js ***! |
| 182 | + \****************/ |
| 183 | +/***/ function(module, exports, require) { |
| 184 | + |
| 185 | + module.exports = {"this is": "y", "but in": "b"}; |
| 186 | + |
| 187 | +/***/ }, |
| 188 | + |
| 189 | +/***/ 8: |
| 190 | +/*!********!*\ |
| 191 | + !*** ***! |
| 192 | + \********/ |
| 193 | +/***/ function(module, exports, require, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { |
| 194 | + |
| 195 | + module.exports = { |
| 196 | + x: require(__webpack_module_template_argument_0__), |
| 197 | + y: require(__webpack_module_template_argument_1__), |
| 198 | + z: require(/*! ../z */ 1) |
| 199 | + } |
| 200 | + |
| 201 | +/***/ } |
| 202 | +/******/ }))) |
| 203 | +``` |
| 204 | + |
| 205 | +# Info |
| 206 | + |
| 207 | +## Uncompressed |
| 208 | + |
| 209 | +``` |
| 210 | +Hash: 4afc9f4631bed4b86de9 |
| 211 | +Version: webpack 0.10.0-beta20 |
| 212 | +Time: 42ms |
| 213 | + Asset Size Chunks Chunk Names |
| 214 | +output.js 3223 0 [emitted] main |
| 215 | +chunk {0} output.js (main) 513 [rendered] |
| 216 | + [0] ./example.js 73 {0} [built] |
| 217 | + [1] ./z.js 34 {0} [built] |
| 218 | + cjs require ../z [2] ./a/index.js 4:4-19 |
| 219 | + cjs require ../z [5] ./b/index.js 4:4-19 |
| 220 | + [2] ./a/index.js 80 {0} [built] |
| 221 | + cjs require ./a [0] ./example.js 1:8-22 |
| 222 | + [3] ./a/x.js 34 {0} [built] |
| 223 | + cjs require ./x [2] ./a/index.js 2:4-18 |
| 224 | + [4] ./a/y.js 49 {0} [built] |
| 225 | + cjs require ./y [2] ./a/index.js 3:4-18 |
| 226 | + [5] ./b/index.js 80 {0} [built] |
| 227 | + cjs require ./b [0] ./example.js 2:8-22 |
| 228 | + [6] ./b/x.js 34 {0} [built] |
| 229 | + cjs require ./x [5] ./b/index.js 2:4-18 |
| 230 | + [7] ./b/y.js 49 {0} [built] |
| 231 | + cjs require ./y [5] ./b/index.js 3:4-18 |
| 232 | + [8] 80 {0} [not cacheable] [built] |
| 233 | + template 1 [2] ./a/index.js |
| 234 | + template 1 [5] ./b/index.js |
| 235 | +``` |
| 236 | + |
| 237 | +## Minimized (uglify-js, no zip) |
| 238 | + |
| 239 | +``` |
| 240 | +Hash: 4afc9f4631bed4b86de9 |
| 241 | +Version: webpack 0.10.0-beta20 |
| 242 | +Time: 98ms |
| 243 | + Asset Size Chunks Chunk Names |
| 244 | +output.js 776 0 [emitted] main |
| 245 | +chunk {0} output.js (main) 513 [rendered] |
| 246 | + [0] ./example.js 73 {0} [built] |
| 247 | + [1] ./z.js 34 {0} [built] |
| 248 | + cjs require ../z [2] ./a/index.js 4:4-19 |
| 249 | + cjs require ../z [5] ./b/index.js 4:4-19 |
| 250 | + [2] ./a/index.js 80 {0} [built] |
| 251 | + cjs require ./a [0] ./example.js 1:8-22 |
| 252 | + [3] ./a/x.js 34 {0} [built] |
| 253 | + cjs require ./x [2] ./a/index.js 2:4-18 |
| 254 | + [4] ./a/y.js 49 {0} [built] |
| 255 | + cjs require ./y [2] ./a/index.js 3:4-18 |
| 256 | + [5] ./b/index.js 80 {0} [built] |
| 257 | + cjs require ./b [0] ./example.js 2:8-22 |
| 258 | + [6] ./b/x.js 34 {0} [built] |
| 259 | + cjs require ./x [5] ./b/index.js 2:4-18 |
| 260 | + [7] ./b/y.js 49 {0} [built] |
| 261 | + cjs require ./y [5] ./b/index.js 3:4-18 |
| 262 | + [8] 80 {0} [not cacheable] [built] |
| 263 | + template 1 [2] ./a/index.js |
| 264 | + template 1 [5] ./b/index.js |
| 265 | +``` |
0 commit comments