2012-04-05 20:59:01 +08:00
|
|
|
|
2012-03-27 06:00:51 +08:00
|
|
|
# example.js
|
|
|
|
|
|
|
|
``` javascript
|
2013-02-13 18:58:13 +08:00
|
|
|
console.log(require("./cup1"));
|
2012-03-27 06:00:51 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
# cup1.coffee
|
|
|
|
|
|
|
|
``` coffee-script
|
|
|
|
module.exports =
|
|
|
|
cool: "stuff"
|
|
|
|
answer: 42
|
|
|
|
external: require "./cup2.coffee"
|
2013-02-13 18:58:13 +08:00
|
|
|
again: require "./cup2"
|
2012-03-27 06:00:51 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
# cup2.coffee
|
|
|
|
|
|
|
|
``` coffee-script
|
|
|
|
console.log "yeah coffee-script"
|
|
|
|
|
|
|
|
module.exports = 42
|
|
|
|
```
|
|
|
|
|
|
|
|
# js/output.js
|
|
|
|
|
|
|
|
``` javascript
|
2013-01-31 01:49:25 +08:00
|
|
|
/******/ (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) {
|
|
|
|
/******/ callback.call(null, require);
|
|
|
|
/******/ };
|
|
|
|
/******/ require.modules = modules;
|
|
|
|
/******/ require.cache = installedModules;
|
|
|
|
/******/ return require(0);
|
|
|
|
/******/ })({
|
|
|
|
/******/ c: "",
|
|
|
|
|
|
|
|
/***/ 0:
|
|
|
|
/*!********************!*\
|
|
|
|
!*** ./example.js ***!
|
|
|
|
\********************/
|
|
|
|
/***/ function(module, exports, require) {
|
|
|
|
|
2013-02-13 18:58:13 +08:00
|
|
|
console.log(require(/*! ./cup1 */ 2));
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
|
|
|
/***/ 1:
|
|
|
|
/*!*********************!*\
|
|
|
|
!*** ./cup2.coffee ***!
|
|
|
|
\*********************/
|
|
|
|
/***/ function(module, exports, require) {
|
|
|
|
|
|
|
|
|
|
|
|
console.log("yeah coffee-script");
|
|
|
|
|
|
|
|
module.exports = 42;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
|
|
|
/***/ 2:
|
|
|
|
/*!*********************!*\
|
|
|
|
!*** ./cup1.coffee ***!
|
|
|
|
\*********************/
|
|
|
|
/***/ function(module, exports, require) {
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
cool: "stuff",
|
|
|
|
answer: 42,
|
|
|
|
external: require(/*! ./cup2.coffee */ 1),
|
|
|
|
again: require(/*! ./cup2 */ 1)
|
|
|
|
};
|
|
|
|
|
2013-01-31 01:49:25 +08:00
|
|
|
|
|
|
|
/***/ }
|
|
|
|
/******/ })
|
|
|
|
|
2012-03-27 06:00:51 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
# Info
|
|
|
|
|
|
|
|
## Uncompressed
|
|
|
|
|
|
|
|
```
|
2013-02-13 18:58:13 +08:00
|
|
|
Hash: 23b825279ba1ed853a1a1b6ce00b97e8
|
2013-02-21 03:50:53 +08:00
|
|
|
Time: 284ms
|
2013-01-31 01:49:25 +08:00
|
|
|
Asset Size Chunks Chunk Names
|
2013-02-21 03:50:53 +08:00
|
|
|
output.js 1465 0 main
|
2013-02-13 18:58:13 +08:00
|
|
|
chunk {0} output.js (main) 208
|
|
|
|
[0] ./example.js 31 [built] {0}
|
|
|
|
[1] ./cup2.coffee 58 [built] {0}
|
|
|
|
cjs require ./cup2 [2] ./cup1.coffee 6:9-26
|
|
|
|
cjs require ./cup2.coffee [2] ./cup1.coffee 5:12-36
|
|
|
|
[2] ./cup1.coffee 119 [built] {0}
|
|
|
|
cjs require ./cup1 [0] ./example.js 1:12-29
|
2012-03-27 06:00:51 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## Minimized (uglify-js, no zip)
|
|
|
|
|
|
|
|
```
|
2013-02-13 18:58:13 +08:00
|
|
|
Hash: 23b825279ba1ed853a1a1b6ce00b97e8
|
2013-02-21 03:50:53 +08:00
|
|
|
Time: 217ms
|
2013-01-31 01:49:25 +08:00
|
|
|
Asset Size Chunks Chunk Names
|
2013-02-21 03:50:53 +08:00
|
|
|
output.js 418 0 main
|
2013-02-13 18:58:13 +08:00
|
|
|
chunk {0} output.js (main) 208
|
|
|
|
[0] ./example.js 31 [built] {0}
|
|
|
|
[1] ./cup2.coffee 58 [built] {0}
|
|
|
|
cjs require ./cup2 [2] ./cup1.coffee 6:9-26
|
|
|
|
cjs require ./cup2.coffee [2] ./cup1.coffee 5:12-36
|
|
|
|
[2] ./cup1.coffee 119 [built] {0}
|
|
|
|
cjs require ./cup1 [0] ./example.js 1:12-29
|
2012-03-27 06:00:51 +08:00
|
|
|
```
|