mirror of https://github.com/webpack/webpack.git
				
				
				
			enable optimization.sideEffects by default
This commit is contained in:
		
							parent
							
								
									8445f06fa9
								
							
						
					
					
						commit
						21337fe49c
					
				| 
						 | 
					@ -363,9 +363,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
 | 
				
			||||||
			if (options.mode === "development") return "named";
 | 
								if (options.mode === "development") return "named";
 | 
				
			||||||
			return "natural";
 | 
								return "natural";
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		this.set("optimization.sideEffects", "make", options =>
 | 
							this.set("optimization.sideEffects", true);
 | 
				
			||||||
			isProductionLikeMode(options)
 | 
					 | 
				
			||||||
		);
 | 
					 | 
				
			||||||
		this.set("optimization.providedExports", true);
 | 
							this.set("optimization.providedExports", true);
 | 
				
			||||||
		this.set("optimization.usedExports", "make", options =>
 | 
							this.set("optimization.usedExports", "make", options =>
 | 
				
			||||||
			isProductionLikeMode(options)
 | 
								isProductionLikeMode(options)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -141,7 +141,7 @@ describe("WebpackOptionsDefaulter", () => {
 | 
				
			||||||
		    "removeAvailableModules": false,
 | 
							    "removeAvailableModules": false,
 | 
				
			||||||
		    "removeEmptyChunks": true,
 | 
							    "removeEmptyChunks": true,
 | 
				
			||||||
		    "runtimeChunk": undefined,
 | 
							    "runtimeChunk": undefined,
 | 
				
			||||||
		    "sideEffects": false,
 | 
							    "sideEffects": true,
 | 
				
			||||||
		    "splitChunks": Object {
 | 
							    "splitChunks": Object {
 | 
				
			||||||
		      "automaticNameDelimiter": "-",
 | 
							      "automaticNameDelimiter": "-",
 | 
				
			||||||
		      "cacheGroups": Object {
 | 
							      "cacheGroups": Object {
 | 
				
			||||||
| 
						 | 
					@ -289,9 +289,6 @@ describe("WebpackOptionsDefaulter", () => {
 | 
				
			||||||
		+     "moduleIds": "deterministic",
 | 
							+     "moduleIds": "deterministic",
 | 
				
			||||||
		+     "noEmitOnErrors": true,
 | 
							+     "noEmitOnErrors": true,
 | 
				
			||||||
		+     "nodeEnv": "production",
 | 
							+     "nodeEnv": "production",
 | 
				
			||||||
		@@ -76,1 +76,1 @@
 | 
					 | 
				
			||||||
		-     "sideEffects": false,
 | 
					 | 
				
			||||||
		+     "sideEffects": true,
 | 
					 | 
				
			||||||
		@@ -94,3 +94,3 @@
 | 
							@@ -94,3 +94,3 @@
 | 
				
			||||||
		-       "hidePathInfo": false,
 | 
							-       "hidePathInfo": false,
 | 
				
			||||||
		-       "maxAsyncRequests": Infinity,
 | 
							-       "maxAsyncRequests": Infinity,
 | 
				
			||||||
| 
						 | 
					@ -345,9 +342,6 @@ describe("WebpackOptionsDefaulter", () => {
 | 
				
			||||||
		+     "moduleIds": "deterministic",
 | 
							+     "moduleIds": "deterministic",
 | 
				
			||||||
		+     "noEmitOnErrors": true,
 | 
							+     "noEmitOnErrors": true,
 | 
				
			||||||
		+     "nodeEnv": "production",
 | 
							+     "nodeEnv": "production",
 | 
				
			||||||
		@@ -76,1 +76,1 @@
 | 
					 | 
				
			||||||
		-     "sideEffects": false,
 | 
					 | 
				
			||||||
		+     "sideEffects": true,
 | 
					 | 
				
			||||||
		@@ -94,3 +94,3 @@
 | 
							@@ -94,3 +94,3 @@
 | 
				
			||||||
		-       "hidePathInfo": false,
 | 
							-       "hidePathInfo": false,
 | 
				
			||||||
		-       "maxAsyncRequests": Infinity,
 | 
							-       "maxAsyncRequests": Infinity,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue