mirror of https://github.com/webpack/webpack.git
				
				
				
			Merge pull request #6894 from webpack/bugfix/css-stuff
fixes for mini-css-extract-plugin
This commit is contained in:
		
						commit
						4b6ee7356d
					
				|  | @ -158,8 +158,6 @@ class Compilation extends Tapable { | |||
| 			beforeChunkAssets: new SyncHook([]), | ||||
| 			additionalChunkAssets: new SyncHook(["chunks"]), | ||||
| 
 | ||||
| 			records: new SyncHook(["compilation", "records"]), | ||||
| 
 | ||||
| 			additionalAssets: new AsyncSeriesHook([]), | ||||
| 			optimizeChunkAssets: new AsyncSeriesHook(["chunks"]), | ||||
| 			afterOptimizeChunkAssets: new SyncHook(["chunks"]), | ||||
|  | @ -278,6 +276,9 @@ class Compilation extends Tapable { | |||
| 		if (this.cache && this.cache[cacheName]) { | ||||
| 			const cacheModule = this.cache[cacheName]; | ||||
| 
 | ||||
| 			if (typeof cacheModule.updateCacheModule === "function") | ||||
| 				cacheModule.updateCacheModule(module); | ||||
| 
 | ||||
| 			let rebuild = true; | ||||
| 			if (this.fileTimestamps && this.contextTimestamps) { | ||||
| 				rebuild = cacheModule.needRebuild( | ||||
|  |  | |||
|  | @ -45,6 +45,12 @@ class ContextModule extends Module { | |||
| 			throw new Error("options.mode is a required option"); | ||||
| 	} | ||||
| 
 | ||||
| 	updateCacheModule(module) { | ||||
| 		this.resolveDependencies = module.resolveDependencies; | ||||
| 		this.options = module.options; | ||||
| 		this.resolveOptions = module.resolveOptions; | ||||
| 	} | ||||
| 
 | ||||
| 	prettyRegExp(regexString) { | ||||
| 		// remove the "/" at the front and the beginning
 | ||||
| 		// "/foo/" -> "foo"
 | ||||
|  |  | |||
|  | @ -47,7 +47,7 @@ module.exports = class HotUpdateChunkTemplate extends Tapable { | |||
| 		hotUpdateChunk.removedModules = removedModules; | ||||
| 		const modulesSource = Template.renderChunkModules( | ||||
| 			hotUpdateChunk, | ||||
| 			() => true, | ||||
| 			m => typeof m.source === "function", | ||||
| 			moduleTemplate, | ||||
| 			dependencyTemplates | ||||
| 		); | ||||
|  |  | |||
|  | @ -338,5 +338,6 @@ Module.prototype.build = null; | |||
| Module.prototype.source = null; | ||||
| Module.prototype.size = null; | ||||
| Module.prototype.nameForCondition = null; | ||||
| Module.prototype.updateCacheModule = null; | ||||
| 
 | ||||
| module.exports = Module; | ||||
|  |  | |||
|  | @ -122,6 +122,15 @@ class NormalModule extends Module { | |||
| 		return this.resource; | ||||
| 	} | ||||
| 
 | ||||
| 	updateCacheModule(module) { | ||||
| 		this.userRequest = module.userRequest; | ||||
| 		this.parser = module.parser; | ||||
| 		this.generator = module.generator; | ||||
| 		this.resource = module.resource; | ||||
| 		this.loaders = module.loaders; | ||||
| 		this.resolveOptions = module.resolveOptions; | ||||
| 	} | ||||
| 
 | ||||
| 	createSourceForAsset(name, content, sourceMap) { | ||||
| 		if (!sourceMap) { | ||||
| 			return new RawSource(content); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue