webpack/examples/coffee-script
Tobias Koppers d0b358d108 update examples 2020-05-20 23:26:51 +02:00
..
README.md update examples 2020-05-20 23:26:51 +02:00
build.js better free var filling, node.js test 2012-04-05 14:59:01 +02:00
cup1.coffee fixed some examples stuff 2013-02-13 11:51:08 +01:00
cup2.coffee fixed examples for lastest updates 2015-06-13 17:44:57 +02:00
example.js fixed some examples stuff 2013-02-13 11:51:08 +01:00
template.md chore(examples): fix exmaples template syntax 2019-04-08 19:26:44 +01:00
webpack.config.js run prettier on existing code 2018-02-25 02:00:20 +01:00

README.md

example.js

console.log(require("./cup1"));

cup1.coffee

module.exports =
	cool: "stuff"
	answer: 42
	external: require "./cup2.coffee"
	again: require "./cup2"

cup2.coffee

console.log "yeah coffee-script"

module.exports = 42

dist/output.js

/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/*!*********************!*\
  !*** ./cup1.coffee ***!
  \*********************/
/*! unknown exports (runtime-defined) */
/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = {
  cool: "stuff",
  answer: 42,
  external: __webpack_require__(/*! ./cup2.coffee */ 2),
  again: __webpack_require__(/*! ./cup2 */ 2)
};


/***/ }),
/* 2 */
/*!*********************!*\
  !*** ./cup2.coffee ***!
  \*********************/
/*! unknown exports (runtime-defined) */
/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */
/*! runtime requirements: module */
/***/ ((module) => {

console.log("yeah coffee-script");

module.exports = 42;


/***/ })
/******/ 	]);
/* webpack runtime code */
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		if(__webpack_module_cache__[moduleId]) {
/******/ 			return __webpack_module_cache__[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
(() => {
/*!********************!*\
  !*** ./example.js ***!
  \********************/
/*! unknown exports (runtime-defined) */
/*! exports [maybe provided (runtime-defined)] [unused] */
/*! runtime requirements: __webpack_require__ */
console.log(__webpack_require__(/*! ./cup1 */ 1));
})();

/******/ })()
;

Info

Unoptimized

Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack 5.0.0-beta.16
    Asset      Size
output.js  2.18 KiB  [emitted]  [name: main]
Entrypoint main = output.js
chunk output.js (main) 206 bytes [entry] [rendered]
    > ./example.js main
 ./cup1.coffee 118 bytes [built]
     cjs require ./cup1 ./example.js 1:12-29
     cjs self exports reference ./cup1.coffee 1:0-14
 ./cup2.coffee 57 bytes [built]
     cjs require ./cup2.coffee ./cup1.coffee 4:12-36
     cjs require ./cup2 ./cup1.coffee 5:9-26
     cjs self exports reference ./cup2.coffee 3:0-14
 ./example.js 31 bytes [built]
     [no exports used]
     entry ./example.js main

Production mode

Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack 5.0.0-beta.16
    Asset       Size
output.js  278 bytes  [emitted]  [name: main]
Entrypoint main = output.js
chunk output.js (main) 206 bytes [entry] [rendered]
    > ./example.js main
 ./cup1.coffee 118 bytes [built]
     cjs require ./cup1 ./example.js 1:12-29
     cjs self exports reference ./cup1.coffee 1:0-14
 ./cup2.coffee 57 bytes [built]
     cjs require ./cup2.coffee ./cup1.coffee 4:12-36
     cjs require ./cup2 ./cup1.coffee 5:9-26
     cjs self exports reference ./cup2.coffee 3:0-14
 ./example.js 31 bytes [built]
     [no exports used]
     entry ./example.js main