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([]), | 			beforeChunkAssets: new SyncHook([]), | ||||||
| 			additionalChunkAssets: new SyncHook(["chunks"]), | 			additionalChunkAssets: new SyncHook(["chunks"]), | ||||||
| 
 | 
 | ||||||
| 			records: new SyncHook(["compilation", "records"]), |  | ||||||
| 
 |  | ||||||
| 			additionalAssets: new AsyncSeriesHook([]), | 			additionalAssets: new AsyncSeriesHook([]), | ||||||
| 			optimizeChunkAssets: new AsyncSeriesHook(["chunks"]), | 			optimizeChunkAssets: new AsyncSeriesHook(["chunks"]), | ||||||
| 			afterOptimizeChunkAssets: new SyncHook(["chunks"]), | 			afterOptimizeChunkAssets: new SyncHook(["chunks"]), | ||||||
|  | @ -278,6 +276,9 @@ class Compilation extends Tapable { | ||||||
| 		if (this.cache && this.cache[cacheName]) { | 		if (this.cache && this.cache[cacheName]) { | ||||||
| 			const cacheModule = this.cache[cacheName]; | 			const cacheModule = this.cache[cacheName]; | ||||||
| 
 | 
 | ||||||
|  | 			if (typeof cacheModule.updateCacheModule === "function") | ||||||
|  | 				cacheModule.updateCacheModule(module); | ||||||
|  | 
 | ||||||
| 			let rebuild = true; | 			let rebuild = true; | ||||||
| 			if (this.fileTimestamps && this.contextTimestamps) { | 			if (this.fileTimestamps && this.contextTimestamps) { | ||||||
| 				rebuild = cacheModule.needRebuild( | 				rebuild = cacheModule.needRebuild( | ||||||
|  |  | ||||||
|  | @ -45,6 +45,12 @@ class ContextModule extends Module { | ||||||
| 			throw new Error("options.mode is a required option"); | 			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) { | 	prettyRegExp(regexString) { | ||||||
| 		// remove the "/" at the front and the beginning
 | 		// remove the "/" at the front and the beginning
 | ||||||
| 		// "/foo/" -> "foo"
 | 		// "/foo/" -> "foo"
 | ||||||
|  |  | ||||||
|  | @ -47,7 +47,7 @@ module.exports = class HotUpdateChunkTemplate extends Tapable { | ||||||
| 		hotUpdateChunk.removedModules = removedModules; | 		hotUpdateChunk.removedModules = removedModules; | ||||||
| 		const modulesSource = Template.renderChunkModules( | 		const modulesSource = Template.renderChunkModules( | ||||||
| 			hotUpdateChunk, | 			hotUpdateChunk, | ||||||
| 			() => true, | 			m => typeof m.source === "function", | ||||||
| 			moduleTemplate, | 			moduleTemplate, | ||||||
| 			dependencyTemplates | 			dependencyTemplates | ||||||
| 		); | 		); | ||||||
|  |  | ||||||
|  | @ -338,5 +338,6 @@ Module.prototype.build = null; | ||||||
| Module.prototype.source = null; | Module.prototype.source = null; | ||||||
| Module.prototype.size = null; | Module.prototype.size = null; | ||||||
| Module.prototype.nameForCondition = null; | Module.prototype.nameForCondition = null; | ||||||
|  | Module.prototype.updateCacheModule = null; | ||||||
| 
 | 
 | ||||||
| module.exports = Module; | module.exports = Module; | ||||||
|  |  | ||||||
|  | @ -122,6 +122,15 @@ class NormalModule extends Module { | ||||||
| 		return this.resource; | 		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) { | 	createSourceForAsset(name, content, sourceMap) { | ||||||
| 		if (!sourceMap) { | 		if (!sourceMap) { | ||||||
| 			return new RawSource(content); | 			return new RawSource(content); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue