webpack/examples/mixed/template.md

48 lines
706 B
Markdown
Raw Permalink Normal View History

2016-09-07 18:25:02 +08:00
This example shows how you can mix different module styles in webpack. Here CommonJs, AMD and Harmony Modules (ES6 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"`).
2014-07-26 22:40:33 +08:00
You see that everything is working nicely together.
2012-08-07 04:19:15 +08:00
# example.js
``` javascript
{{example.js}}
```
2012-08-07 04:25:48 +08:00
# amd.js
2012-08-07 04:19:15 +08:00
``` javascript
{{amd.js}}
```
2012-08-07 04:25:48 +08:00
# commonjs.js
2012-08-07 04:19:15 +08:00
``` javascript
{{commonjs.js}}
```
# js/output.js
``` javascript
{{js/output.js}}
```
# js/0.output.js
2012-08-09 17:32:02 +08:00
``` javascript
{{js/0.output.js}}
2012-08-09 17:32:02 +08:00
```
2012-08-07 04:19:15 +08:00
# Info
## Uncompressed
```
{{stdout}}
```
## Minimized (uglify-js, no zip)
```
{{min:stdout}}
```