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.
34 lines • 4.93 kB
JavaScript
!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([/*!**********************************!*\
!*** ./loaders/context/index.js ***!
\**********************************/
function(t,e,r){it("should be able to use a context with a loader",function(){var t="abc",e="script.coffee";r(/*! ../_resources */7)("./"+e).should.be.eql("coffee test"),r(/*! raw!../_resources */8)("./"+t+".txt").should.be.eql("abc")})},/*!******************************************!*\
!*** ./loaders/_resources/included.jade ***!
\******************************************/
function(t,e,r){r(/*! (webpack)/~/jade/lib/runtime.js */2);t.exports=function(){var t=[];return t.push("<h1>included</h1>"),t.join("")}},/*!***************************************!*\
!*** (webpack)/~/jade/lib/runtime.js ***!
\***************************************/
function(t,e,r){"use strict";function n(t){return null!=t&&""!==t}function o(t){return Array.isArray(t)?t.map(o).filter(n).join(" "):t}e.merge=function i(t,e){if(1===arguments.length){for(var r=t[0],o=1;o<t.length;o++)r=i(r,t[o]);return r}var s=t["class"],a=e["class"];(s||a)&&(s=s||[],a=a||[],Array.isArray(s)||(s=[s]),Array.isArray(a)||(a=[a]),t["class"]=s.concat(a).filter(n));for(var u in e)"class"!=u&&(t[u]=e[u]);return t},e.joinClasses=o,e.cls=function(t,r){for(var n=[],i=0;i<t.length;i++)n.push(r&&r[i]?e.escape(o([t[i]])):o(t[i]));var s=o(n);return s.length?' class="'+s+'"':""},e.attr=function(t,r,n,o){return"boolean"==typeof r||null==r?r?" "+(o?t:t+'="'+t+'"'):"":0==t.indexOf("data")&&"string"!=typeof r?" "+t+"='"+JSON.stringify(r).replace(/'/g,"'")+"'":n?" "+t+'="'+e.escape(r)+'"':" "+t+'="'+r+'"'},e.attrs=function(t,r){var n=[],i=Object.keys(t);if(i.length)for(var s=0;s<i.length;++s){var a=i[s],u=t[a];"class"==a?(u=o(u))&&n.push(" "+a+'="'+u+'"'):n.push(e.attr(a,u,!1,r))}return n.join("")},e.escape=function(t){var e=String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return e===""+t?t:e},e.rethrow=function s(t,e,n,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&e||o))throw t.message+=" on line "+n,t;try{o=o||r(/*! fs */10).readFileSync(e,"utf8")}catch(i){s(t,null,n)}var a=3,u=o.split("\n"),c=Math.max(n-a,0),l=Math.min(u.length,n+a),a=u.slice(c,l).map(function(t,e){var r=e+c+1;return(r==n?" > ":" ")+r+"| "+t}).join("\n");throw t.path=e,t.message=(e||"Jade")+":"+n+"\n"+a+"\n\n"+t.message,t}},/*!******************************************!*\
!*** ./loaders/_resources/script.coffee ***!
\******************************************/
function(t){var e,r;e=!0,r={text:"coffee test"},null!=e&&(t.exports=r.text)},/*!****************************************!*\
!*** ./loaders/_resources/parent.jade ***!
\****************************************/
function(t,e,r){r(/*! (webpack)/~/jade/lib/runtime.js */2);t.exports=function(t){var e,n=[];/*! ./loaders/_resources/included.jade */return n.push("<p></p>"+(null==(e=r(1).call(this,t))?"":e)),n.join("")}},/*!******************************************!*\
!*** ./loaders/_resources/template.jade ***!
\******************************************/
function(t,e,r){var n=r(/*! (webpack)/~/jade/lib/runtime.js */2);t.exports=function(t){var e,o=[],i=t||{},s=i.abc,a=i.self;/*! ./loaders/_resources/included.jade */return o.push("<p>"+n.escape(null==(e="undefined"==typeof s?"self"+a.abc:s)?"":e)+"</p>"+(null==(e=r(1).call(this,t))?"":e)),o.join("")}},/*!***********************************************************!*\
!*** (webpack)/~/raw-loader!./loaders/_resources/abc.txt ***!
\***********************************************************/
function(t){t.exports="abc"},/*!*************************************!*\
!*** ./loaders/_resources ^\.\/.*$ ***!
\*************************************/
function(t,e,r){function n(t){return r(o(t))}function o(t){return i[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var i={"./abc.txt":9,"./included.jade":1,"./parent.jade":4,"./script.coffee":3,"./template.jade":5};n.keys=function(){return Object.keys(i)},n.resolve=o,t.exports=n,n.id=7},/*!*****************************************************************!*\
!*** ./loaders/_resources (webpack)/~/raw-loader!^\.\/.*\.txt$ ***!
\*****************************************************************/
function(t,e,r){function n(t){return r(o(t))}function o(t){return i[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var i={"./abc.txt":6};n.keys=function(){return Object.keys(i)},n.resolve=o,t.exports=n,n.id=8},/*!************************************!*\
!*** ./loaders/_resources/abc.txt ***!
\************************************/
function(){},/*!*********************!*\
!*** external "fs" ***!
\*********************/
function(t){t.exports=require("fs")}]);