mirror of https://github.com/webpack/webpack.git
				
				
				
			add more breaking change info
This commit is contained in:
		
							parent
							
								
									8295202bc8
								
							
						
					
					
						commit
						9c0b320fd4
					
				|  | @ -11,34 +11,61 @@ const validate = require("schema-utils"); | |||
| const DID_YOU_MEAN = { | ||||
| 	rules: "module.rules", | ||||
| 	loaders: "module.rules or module.rules.*.use", | ||||
| 	query: "module.rules.*.options (BREAKING CHANGE since webpack 5)", | ||||
| 	noParse: "module.noParse", | ||||
| 	filename: "output.filename or module.rules.*.generator.filename", | ||||
| 	file: "output.filename", | ||||
| 	jsonpFunction: "output.chunkLoadingGlobal", | ||||
| 	chunkCallbackName: "output.chunkLoadingGlobal", | ||||
| 	hotUpdateFunction: "output.hotUpdateGlobal", | ||||
| 	chunkFilename: "output.chunkFilename", | ||||
| 	chunkfilename: "output.chunkFilename", | ||||
| 	ecmaVersion: "output.environment", | ||||
| 	ecmaversion: "output.environment", | ||||
| 	ecma: "output.environment", | ||||
| 	ecmaVersion: | ||||
| 		"output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)", | ||||
| 	ecmaversion: | ||||
| 		"output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)", | ||||
| 	ecma: | ||||
| 		"output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)", | ||||
| 	path: "output.path", | ||||
| 	pathinfo: "output.pathinfo", | ||||
| 	pathInfo: "output.pathinfo", | ||||
| 	jsonpFunction: "output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)", | ||||
| 	chunkCallbackName: | ||||
| 		"output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)", | ||||
| 	jsonpScriptType: "output.scriptType (BREAKING CHANGE since webpack 5)", | ||||
| 	hotUpdateFunction: "output.hotUpdateGlobal (BREAKING CHANGE since webpack 5)", | ||||
| 	splitChunks: "optimization.splitChunks", | ||||
| 	immutablePaths: "snapshot.immutablePaths", | ||||
| 	managedPaths: "snapshot.managedPaths", | ||||
| 	maxModules: "stats.modulesSpace", | ||||
| 	maxModules: "stats.modulesSpace (BREAKING CHANGE since webpack 5)", | ||||
| 	hashedModuleIds: | ||||
| 		'optimization.moduleIds: "hashed" (BREAKING CHANGE since webpack 5)', | ||||
| 	namedChunks: | ||||
| 		'optimization.chunkIds: "named" (BREAKING CHANGE since webpack 5)', | ||||
| 	namedModules: | ||||
| 		'optimization.moduleIds: "named" (BREAKING CHANGE since webpack 5)', | ||||
| 	occurrenceOrder: | ||||
| 		'optimization.chunkIds: "size" and optimization.moduleIds: "size" (BREAKING CHANGE since webpack 5)', | ||||
| 	automaticNamePrefix: | ||||
| 		"optimization.splitChunks.[cacheGroups.*].idHint (BREAKING CHANGE since webpack 5)", | ||||
| 	noEmitOnErrors: | ||||
| 		"optimization.emitOnErrors (BREAKING CHANGE since webpack 5: logic is inverted to avoid negative flags)" | ||||
| 		"optimization.emitOnErrors (BREAKING CHANGE since webpack 5: logic is inverted to avoid negative flags)", | ||||
| 	Buffer: | ||||
| 		"to use the ProvidePlugin to process the Buffer variable to modules as polyfill\n" + | ||||
| 		"BREAKING CHANGE: webpack 5 no longer provided Node.js polyfills by default.\n" + | ||||
| 		"Note: if you are using 'node.Buffer: false', you can just remove that as this is the default behavior now.\n" + | ||||
| 		"To provide a polyfill to modules use:\n" + | ||||
| 		'new ProvidePlugin({ Buffer: ["buffer", "Buffer"] }) and npm install buffer.', | ||||
| 	process: | ||||
| 		"to use the ProvidePlugin to process the process variable to modules as polyfill\n" + | ||||
| 		"BREAKING CHANGE: webpack 5 no longer provided Node.js polyfills by default.\n" + | ||||
| 		"Note: if you are using 'node.process: false', you can just remove that as this is the default behavior now.\n" + | ||||
| 		"To provide a polyfill to modules use:\n" + | ||||
| 		'new ProvidePlugin({ process: "process" }) and npm install buffer.' | ||||
| }; | ||||
| 
 | ||||
| const REMOVED = { | ||||
| 	concord: | ||||
| 		"BREAKING CHANGE: resolve.concord has been removed and is no longer avaiable.", | ||||
| 	devtoolLineToLine: | ||||
| 		"BREAKING CHANGE: output.devtoolLineToLine has been removed and is no longer avaiable." | ||||
| }; | ||||
| /* cSpell:enable */ | ||||
| 
 | ||||
|  | @ -84,6 +111,15 @@ const validateSchema = (schema, options) => { | |||
| 					}?`;
 | ||||
| 				} | ||||
| 
 | ||||
| 				if ( | ||||
| 					Object.prototype.hasOwnProperty.call( | ||||
| 						REMOVED, | ||||
| 						params.additionalProperty | ||||
| 					) | ||||
| 				) { | ||||
| 					return `${formattedError}\n${REMOVED[params.additionalProperty]}?`; | ||||
| 				} | ||||
| 
 | ||||
| 				if (!error.dataPath) { | ||||
| 					if (params.additionalProperty === "debug") { | ||||
| 						return ( | ||||
|  |  | |||
|  | @ -498,7 +498,7 @@ describe("Validation", () => { | |||
| 			 - configuration.output has an unknown property 'ecmaVersion'. These properties are valid: | ||||
| 			   object { assetModuleFilename?, auxiliaryComment?, charset?, chunkFilename?, chunkFormat?, chunkLoadTimeout?, chunkLoading?, chunkLoadingGlobal?, compareBeforeEmit?, crossOriginLoading?, devtoolFallbackModuleFilenameTemplate?, devtoolModuleFilenameTemplate?, devtoolNamespace?, enabledChunkLoadingTypes?, enabledLibraryTypes?, enabledWasmLoadingTypes?, environment?, filename?, globalObject?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFilename?, hotUpdateGlobal?, hotUpdateMainFilename?, iife?, importFunctionName?, importMetaName?, library?, libraryExport?, libraryTarget?, module?, path?, pathinfo?, publicPath?, scriptType?, sourceMapFilename?, sourcePrefix?, strictModuleExceptionHandling?, umdNamedDefine?, uniqueName?, wasmLoading?, webassemblyModuleFilename?, workerChunkLoading?, workerWasmLoading? } | ||||
| 			   -> Options affecting the output of the compilation. \`output\` options tell webpack how to write the compiled files to disk.
 | ||||
| 			   Did you mean output.environment?" | ||||
| 			   Did you mean output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)?" | ||||
| 		`)
 | ||||
| 	); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue