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.

55 lines (35 loc) 796 B
This example shows how you can mix different module styles in webpack. Here CommonJs, AMD and Labeled Modules are used. In addition to that there are different types of dynamic requires (`"../require.context/templates/"+amd1+".js"` and `Math.random() < 0.5 ? "./commonjs" : "./amd"`). You see that everything is working nicely together. # example.js ``` javascript {{example.js}} ``` # amd.js ``` javascript {{amd.js}} ``` # commonjs.js ``` javascript {{commonjs.js}} ``` # labeled.js ``` javascript {{labeled.js}} ``` # js/output.js ``` javascript {{js/output.js}} ``` # js/0.output.js ``` javascript {{js/0.output.js}} ``` # Info ## Uncompressed ``` {{stdout}} ``` ## Minimized (uglify-js, no zip) ``` {{min:stdout}} ```