mirror of https://github.com/webpack/webpack.git
				
				
				
			Merge pull request #11603 from MayaWolf/master
Fix require handling with electron; fixes #11599
This commit is contained in:
		
						commit
						bfc35d6fbe
					
				| 
						 | 
				
			
			@ -581,9 +581,9 @@ const applyOutputDefaults = (
 | 
			
		|||
	});
 | 
			
		||||
	F(output, "chunkFormat", () => {
 | 
			
		||||
		if (tp) {
 | 
			
		||||
			if (tp.document) return "array-push";
 | 
			
		||||
			if (tp.require) return "commonjs";
 | 
			
		||||
			if (tp.nodeBuiltins) return "commonjs";
 | 
			
		||||
			if (tp.document) return "array-push";
 | 
			
		||||
			if (tp.importScripts) return "array-push";
 | 
			
		||||
			if (tp.dynamicImport && output.module) return "module";
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -591,9 +591,9 @@ const applyOutputDefaults = (
 | 
			
		|||
	});
 | 
			
		||||
	F(output, "chunkLoading", () => {
 | 
			
		||||
		if (tp) {
 | 
			
		||||
			if (tp.document) return "jsonp";
 | 
			
		||||
			if (tp.require) return "require";
 | 
			
		||||
			if (tp.nodeBuiltins) return "async-node";
 | 
			
		||||
			if (tp.document) return "jsonp";
 | 
			
		||||
			if (tp.importScripts) return "import-scripts";
 | 
			
		||||
			if (tp.dynamicImport && output.module) return "import";
 | 
			
		||||
			if (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ class ElectronTargetPlugin {
 | 
			
		|||
			"original-fs",
 | 
			
		||||
			"screen",
 | 
			
		||||
			"shell"
 | 
			
		||||
		]);
 | 
			
		||||
		]).apply(compiler);
 | 
			
		||||
		switch (this._context) {
 | 
			
		||||
			case "main":
 | 
			
		||||
				new ExternalsPlugin("commonjs", [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue