Skip to content

Latest commit

 

History

History
executable file
·
19 lines (13 loc) · 424 Bytes

rewrites.md

File metadata and controls

executable file
·
19 lines (13 loc) · 424 Bytes

rewrites

This callback will iterate the assets, and externals array in service worker file gerenated by the plugin. This will help developers to modify assets for various scenarios such as multiple cdn domains for assets.

rewrites: function(asset) {
	
	if (asset.endsWith('html')) {
		return 'https://www.qq.com/' + asset;
	}
	else {
		return 'https://s1.url.cn/' + asset;
	}

	return asset;	
}