You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					43 lines
				
				1.0 KiB
			
		
		
			
		
	
	
					43 lines
				
				1.0 KiB
			| 
								 
											4 years ago
										 
									 | 
							
								module.exports = options => ({
							 | 
						||
| 
								 | 
							
								  terserOptions: {
							 | 
						||
| 
								 | 
							
								    compress: {
							 | 
						||
| 
								 | 
							
								      // turn off flags with small gains to speed up minification
							 | 
						||
| 
								 | 
							
								      arrows: false,
							 | 
						||
| 
								 | 
							
								      collapse_vars: false, // 0.3kb
							 | 
						||
| 
								 | 
							
								      comparisons: false,
							 | 
						||
| 
								 | 
							
								      computed_props: false,
							 | 
						||
| 
								 | 
							
								      hoist_funs: false,
							 | 
						||
| 
								 | 
							
								      hoist_props: false,
							 | 
						||
| 
								 | 
							
								      hoist_vars: false,
							 | 
						||
| 
								 | 
							
								      inline: false,
							 | 
						||
| 
								 | 
							
								      loops: false,
							 | 
						||
| 
								 | 
							
								      negate_iife: false,
							 | 
						||
| 
								 | 
							
								      properties: false,
							 | 
						||
| 
								 | 
							
								      reduce_funcs: false,
							 | 
						||
| 
								 | 
							
								      reduce_vars: false,
							 | 
						||
| 
								 | 
							
								      switches: false,
							 | 
						||
| 
								 | 
							
								      toplevel: false,
							 | 
						||
| 
								 | 
							
								      typeofs: false,
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      // a few flags with noticable gains/speed ratio
							 | 
						||
| 
								 | 
							
								      // numbers based on out of the box vendor bundle
							 | 
						||
| 
								 | 
							
								      booleans: true, // 0.7kb
							 | 
						||
| 
								 | 
							
								      if_return: true, // 0.4kb
							 | 
						||
| 
								 | 
							
								      sequences: true, // 0.7kb
							 | 
						||
| 
								 | 
							
								      unused: true, // 2.3kb
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      // required features to drop conditional branches
							 | 
						||
| 
								 | 
							
								      conditionals: true,
							 | 
						||
| 
								 | 
							
								      dead_code: true,
							 | 
						||
| 
								 | 
							
								      evaluate: true
							 | 
						||
| 
								 | 
							
								    },
							 | 
						||
| 
								 | 
							
								    mangle: {
							 | 
						||
| 
								 | 
							
								      safari10: true
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								  },
							 | 
						||
| 
								 | 
							
								  sourceMap: options.productionSourceMap,
							 | 
						||
| 
								 | 
							
								  cache: true,
							 | 
						||
| 
								 | 
							
								  parallel: options.parallel,
							 | 
						||
| 
								 | 
							
								  extractComments: false
							 | 
						||
| 
								 | 
							
								})
							 |