2016-12-10 12:32:42 +08:00
# example.js
This example illustrates how to leverage the `import()` syntax to create ContextModules which are separated into separate chunks for each module in the `./templates` folder.
2019-04-05 05:04:47 +08:00
```javascript
_{{example.js}}_
2016-12-10 12:32:42 +08:00
```
# templates/
2019-04-05 05:04:47 +08:00
- foo.js
- baz.js
- bar.js
2016-12-10 12:32:42 +08:00
All templates are of this pattern:
2019-04-05 05:04:47 +08:00
```javascript
_{{templates/foo.js}}_
2016-12-10 12:59:20 +08:00
```
2018-01-05 04:39:29 +08:00
# dist/output.js
2016-12-10 12:32:42 +08:00
2019-04-05 05:04:47 +08:00
```javascript
_{{dist/output.js}}_
2016-12-10 12:32:42 +08:00
```
# Info
2017-12-14 17:09:09 +08:00
## Unoptimized
2016-12-10 12:32:42 +08:00
```
2019-04-05 05:04:47 +08:00
_{{stdout}}_
2016-12-10 12:32:42 +08:00
```
2017-12-14 17:09:09 +08:00
## Production mode
2016-12-10 12:32:42 +08:00
```
2019-04-05 05:04:47 +08:00
_{{production:stdout}}_
2016-12-10 12:32:42 +08:00
```