mirror of https://github.com/webpack/webpack.git
				
				
				
			
		
			
				
	
	
		
			35 lines
		
	
	
		
			680 B
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			680 B
		
	
	
	
		
			JavaScript
		
	
	
	
| var path = require("path");
 | |
| 
 | |
| module.exports = {
 | |
| 	// mode: "development" || "production",
 | |
| 	entry: {
 | |
| 		pageA: "./pageA",
 | |
| 		pageB: "./pageB",
 | |
| 		pageC: "./pageC"
 | |
| 	},
 | |
| 	optimization: {
 | |
| 		chunkIds: "named",
 | |
| 		splitChunks: {
 | |
| 			cacheGroups: {
 | |
| 				commons: {
 | |
| 					chunks: "initial",
 | |
| 					minChunks: 2,
 | |
| 					maxInitialRequests: 5, // The default limit is too small to showcase the effect
 | |
| 					minSize: 0 // This is example is too small to create commons chunks
 | |
| 				},
 | |
| 				vendor: {
 | |
| 					test: /node_modules/,
 | |
| 					chunks: "initial",
 | |
| 					name: "vendor",
 | |
| 					priority: 10,
 | |
| 					enforce: true
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	},
 | |
| 	output: {
 | |
| 		path: path.join(__dirname, "dist"),
 | |
| 		filename: "[name].js"
 | |
| 	}
 | |
| };
 |