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.
14 lines • 770 B
JavaScript
// Single File Libary
window.test(window.writing, "Lib1 Should be in first tick");
window.test(typeof window.libary1 === "undefined", "Lib1 should be only loaded once");
window.test(require("./lib/component") === "lib1 component", "Lib1 component loaded");
require.ensure(["submodule1", "submodule2"], function(require) {
window.test(window.writing, "Lib1 Should be in first tick too");
window.test(require("submodule1") === "submodule1", "Lib1 submodule1 loaded");
window.test(require("submodule2") === "submodule2", "Lib1 submodule2 loaded");
window.test(require("submodule3")() === "submodule3", "Lib1 submodule3 loaded");
require.ensure([], function(require) {
window.test(window.writing, "Lib1 Should be still in first tick");
});
});
module.exports = true;