File size: 478 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module.exports = class ReadonlyCachePlugin {
	apply( compiler ) {
		compiler.cache.hooks.store.intercept( {
			register: ( tapInfo ) => {
				compiler
					.getInfrastructureLogger( 'webpack.cache.ReadonlyCachePlugin' )
					.info( `Cache is in read only mode. ${ tapInfo.name } won't be executed` );
				return {
					...tapInfo,
					fn: function () {
						//A no-op function prevent any hook to `compiler.cache.hooks.store` to do anything.
					},
				};
			},
		} );
	}
};