UNPKG

webpack

Version:

Packs CommonJs/AMD 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.

145 lines (123 loc) 13.4 kB
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_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(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /*!**********************************!*\ !*** ./loaders/context/index.js ***! \**********************************/ /***/ function(module, exports, __webpack_require__) { eval("it(\"should be able to use a context with a loader\", function() {\r\n\tvar abc = \"abc\", scr = \"script.coffee\";\r\n\t__webpack_require__(/*! ../_resources */ 1)(\"./\" + scr).should.be.eql(\"coffee test\");\r\n\t__webpack_require__(/*! raw!../_resources */ 3)(\"./\" + abc + \".txt\").should.be.eql(\"abc\");\r\n});\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/context/index.js\n ** module id = 0\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/context/index.js?"); /***/ }, /* 1 */ /*!*************************************!*\ !*** ./loaders/_resources ^\.\/.*$ ***! \*************************************/ /***/ function(module, exports, __webpack_require__) { eval("var map = {\n\t\"./abc.txt\": 2,\n\t\"./included.jade\": 5,\n\t\"./parent.jade\": 6,\n\t\"./script.coffee\": 8,\n\t\"./template.jade\": 7\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 1;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources ^\\.\\/.*$\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources_^\\.\\/.*$?"); /***/ }, /* 2 */ /*!************************************!*\ !*** ./loaders/_resources/abc.txt ***! \************************************/ /***/ function(module, exports, __webpack_require__) { eval("abc\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources/abc.txt\n ** module id = 2\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources/abc.txt?"); /***/ }, /* 3 */ /*!*****************************************************************!*\ !*** ./loaders/_resources (webpack)/~/raw-loader!^\.\/.*\.txt$ ***! \*****************************************************************/ /***/ function(module, exports, __webpack_require__) { eval("var map = {\n\t\"./abc.txt\": 4\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 3;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources (webpack)/~/raw-loader!^\\.\\/.*\\.txt$\n ** module id = 3\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///^\\.\\/.*\\.txt$?./loaders/_resources_(webpack)/~/raw-loader"); /***/ }, /* 4 */ /*!***********************************************************!*\ !*** (webpack)/~/raw-loader!./loaders/_resources/abc.txt ***! \***********************************************************/ /***/ function(module, exports, __webpack_require__) { eval("module.exports = \"abc\"\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/~/raw-loader!./loaders/_resources/abc.txt\n ** module id = 4\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources/abc.txt?(webpack)/~/raw-loader"); /***/ }, /* 5 */ /*!******************************************!*\ !*** ./loaders/_resources/included.jade ***! \******************************************/ /***/ function(module, exports, __webpack_require__) { eval("var jade = __webpack_require__(/*! (webpack)/~/jade/lib/runtime.js */ 11);\n\nmodule.exports = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<h1>included</h1>\");;return buf.join(\"\");\n}\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources/included.jade\n ** module id = 5\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources/included.jade?"); /***/ }, /* 6 */ /*!****************************************!*\ !*** ./loaders/_resources/parent.jade ***! \****************************************/ /***/ function(module, exports, __webpack_require__) { eval("var jade = __webpack_require__(/*! (webpack)/~/jade/lib/runtime.js */ 11);\n\nmodule.exports = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<p></p>\" + (null == (jade_interp = __webpack_require__(/*! ./loaders/_resources/included.jade */ 5).call(this, locals)) ? \"\" : jade_interp));;return buf.join(\"\");\n}\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources/parent.jade\n ** module id = 6\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources/parent.jade?"); /***/ }, /* 7 */ /*!******************************************!*\ !*** ./loaders/_resources/template.jade ***! \******************************************/ /***/ function(module, exports, __webpack_require__) { eval("var jade = __webpack_require__(/*! (webpack)/~/jade/lib/runtime.js */ 11);\n\nmodule.exports = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\nvar locals_ = (locals || {}),abc = locals_.abc,self = locals_.self;\nbuf.push(\"<p>\" + (jade.escape(null == (jade_interp = typeof abc === \"undefined\" ? \"self\" + self.abc : abc) ? \"\" : jade_interp)) + \"</p>\" + (null == (jade_interp = __webpack_require__(/*! ./loaders/_resources/included.jade */ 5).call(this, locals)) ? \"\" : jade_interp));;return buf.join(\"\");\n}\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources/template.jade\n ** module id = 7\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources/template.jade?"); /***/ }, /* 8 */ /*!******************************************!*\ !*** ./loaders/_resources/script.coffee ***! \******************************************/ /***/ function(module, exports, __webpack_require__) { eval("var condition, obj;\n\ncondition = true;\n\nobj = {\n text: \"coffee test\"\n};\n\nif (condition != null) {\n module.exports = obj.text;\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./loaders/_resources/script.coffee\n ** module id = 8\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./loaders/_resources/script.coffee?"); /***/ }, /* 9 */, /* 10 */, /* 11 */ /*!***************************************!*\ !*** (webpack)/~/jade/lib/runtime.js ***! \***************************************/ /***/ function(module, exports, __webpack_require__) { eval("'use strict';\n\n/**\n * Merge two attribute objects giving precedence\n * to values in object `b`. Classes are special-cased\n * allowing for arrays and merging/joining appropriately\n * resulting in a string.\n *\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n * @api private\n */\n\nexports.merge = function merge(a, b) {\n if (arguments.length === 1) {\n var attrs = a[0];\n for (var i = 1; i < a.length; i++) {\n attrs = merge(attrs, a[i]);\n }\n return attrs;\n }\n var ac = a['class'];\n var bc = b['class'];\n\n if (ac || bc) {\n ac = ac || [];\n bc = bc || [];\n if (!Array.isArray(ac)) ac = [ac];\n if (!Array.isArray(bc)) bc = [bc];\n a['class'] = ac.concat(bc).filter(nulls);\n }\n\n for (var key in b) {\n if (key != 'class') {\n a[key] = b[key];\n }\n }\n\n return a;\n};\n\n/**\n * Filter null `val`s.\n *\n * @param {*} val\n * @return {Boolean}\n * @api private\n */\n\nfunction nulls(val) {\n return val != null && val !== '';\n}\n\n/**\n * join array as classes.\n *\n * @param {*} val\n * @return {String}\n */\nexports.joinClasses = joinClasses;\nfunction joinClasses(val) {\n return Array.isArray(val) ? val.map(joinClasses).filter(nulls).join(' ') : val;\n}\n\n/**\n * Render the given classes.\n *\n * @param {Array} classes\n * @param {Array.<Boolean>} escaped\n * @return {String}\n */\nexports.cls = function cls(classes, escaped) {\n var buf = [];\n for (var i = 0; i < classes.length; i++) {\n if (escaped && escaped[i]) {\n buf.push(exports.escape(joinClasses([classes[i]])));\n } else {\n buf.push(joinClasses(classes[i]));\n }\n }\n var text = joinClasses(buf);\n if (text.length) {\n return ' class=\"' + text + '\"';\n } else {\n return '';\n }\n};\n\n/**\n * Render the given attribute.\n *\n * @param {String} key\n * @param {String} val\n * @param {Boolean} escaped\n * @param {Boolean} terse\n * @return {String}\n */\nexports.attr = function attr(key, val, escaped, terse) {\n if ('boolean' == typeof val || null == val) {\n if (val) {\n return ' ' + (terse ? key : key + '=\"' + key + '\"');\n } else {\n return '';\n }\n } else if (0 == key.indexOf('data') && 'string' != typeof val) {\n return ' ' + key + \"='\" + JSON.stringify(val).replace(/'/g, '&apos;') + \"'\";\n } else if (escaped) {\n return ' ' + key + '=\"' + exports.escape(val) + '\"';\n } else {\n return ' ' + key + '=\"' + val + '\"';\n }\n};\n\n/**\n * Render the given attributes object.\n *\n * @param {Object} obj\n * @param {Object} escaped\n * @return {String}\n */\nexports.attrs = function attrs(obj, terse){\n var buf = [];\n\n var keys = Object.keys(obj);\n\n if (keys.length) {\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i]\n , val = obj[key];\n\n if ('class' == key) {\n if (val = joinClasses(val)) {\n buf.push(' ' + key + '=\"' + val + '\"');\n }\n } else {\n buf.push(exports.attr(key, val, false, terse));\n }\n }\n }\n\n return buf.join('');\n};\n\n/**\n * Escape the given string of `html`.\n *\n * @param {String} html\n * @return {String}\n * @api private\n */\n\nexports.escape = function escape(html){\n var result = String(html)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;');\n if (result === '' + html) return html;\n else return result;\n};\n\n/**\n * Re-throw the given `err` in context to the\n * the jade in `filename` at the given `lineno`.\n *\n * @param {Error} err\n * @param {String} filename\n * @param {String} lineno\n * @api private\n */\n\nexports.rethrow = function rethrow(err, filename, lineno, str){\n if (!(err instanceof Error)) throw err;\n if ((typeof window != 'undefined' || !filename) && !str) {\n err.message += ' on line ' + lineno;\n throw err;\n }\n try {\n str = str || __webpack_require__(/*! fs */ 12).readFileSync(filename, 'utf8')\n } catch (ex) {\n rethrow(err, null, lineno)\n }\n var context = 3\n , lines = str.split('\\n')\n , start = Math.max(lineno - context, 0)\n , end = Math.min(lines.length, lineno + context);\n\n // Error context\n var context = lines.slice(start, end).map(function(line, i){\n var curr = i + start + 1;\n return (curr == lineno ? ' > ' : ' ')\n + curr\n + '| '\n + line;\n }).join('\\n');\n\n // Alter exception message\n err.path = filename;\n err.message = (filename || 'Jade') + ':' + lineno\n + '\\n' + context + '\\n\\n' + err.message;\n throw err;\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/~/jade/lib/runtime.js\n ** module id = 11\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///(webpack)/~/jade/lib/runtime.js?"); /***/ }, /* 12 */ /*!*********************!*\ !*** external "fs" ***! \*********************/ /***/ function(module, exports, __webpack_require__) { eval("module.exports = require(\"fs\");\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"fs\"\n ** module id = 12\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///external_%22fs%22?"); /***/ } /******/ ])