UNPKG

webpack

Version:

Packs CommonJs Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loading of js, json, jade, coffee, css, ... out of the box and more with custom loaders.

45 lines (44 loc) 1.55 kB
<html> <head> <title>webpack tests</title> <script> window.test = function(ok, message) { document.write("<p " + (ok?">OK: ":"style='color: red; font-weight: bold;'>FAILED: ")+message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;") + "</p>"); }; window.onerror = function(error) { window.test(false, "Shouldn't throw error: " + error); }; window.writing = true; </script> <script src="js/libary2.js" charset="utf-8"></script> <script src="js/web.js" charset="utf-8"></script> <script> window.test = function(ok, message) { var p = document.createElement("p"); p.appendChild(document.createTextNode((ok?"OK: ":"FAILED: ")+message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"))); if(!ok) p.setAttribute("style", "color: red; font-weight: bold;"); document.body.appendChild(p); }; window.writing = false; </script> <style> span { background: red; } </style> </head> <body> <p> <span class="rule-direct">Buildin 'style!css' loader, direct content</span> <span class="rule-import1">Buildin 'style!css' loader, imported rule</span> <span class="rule-import2">Buildin 'style!css' loader, double imported rule</span> </p> <p> <span class="less-rule-direct">Buildin 'style!less' loader, direct content</span> <span class="less-rule-import1">Buildin 'style!less' loader, imported rule</span> <span class="less-rule-import2">Buildin 'style!less' loader, double imported rule</span> </p> <p><img src="img/fail.png" id="image" /></p> </body> </html>