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.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								``` javascript
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{{example.js}}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# templates/
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-12-10 12:59:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  foo.js 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								*  baz.js 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								*  bar.js 
						 
					
						
							
								
									
										
										
										
											2016-12-10 12:32:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								All templates are of this pattern:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								``` javascript
							 
						 
					
						
							
								
									
										
										
										
											2016-12-14 19:03:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{{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 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								``` javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-01-05 04:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{{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 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{{stdout}}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-14 17:09:09 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Production mode
  
						 
					
						
							
								
									
										
										
										
											2016-12-10 12:32:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2017-12-14 17:09:09 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{{production:stdout}}
							 
						 
					
						
							
								
									
										
										
										
											2016-12-10 12:32:42 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```