function minifyCssPlugin({ sourcemap } = {}) {
	return {
		name: 'minify-css',
		async resolveId(id, importer) {
			if (id.startsWith('css:')) {
				const resolved = await this.resolve(id.substring(4), importer);
				if (resolved) {
					resolved.id = 'css:' + resolved.id;
					return resolved;
				}
			}
		},

		async generateBundle(_, bundle) {
			await Promise.all(
				Object.values(bundle).map(async asset => {
					if (asset.type !== 'asset' || !isCssFilename(asset.fileName)) return;
					const id = asset.fileName;
					const mapFile = asset.fileName + '.map';
					let result;
					try {
						result = await processor.process(asset.source, {
							from: id,
							to: id,
							map: sourcemap && {
								annotation: posix.basename(mapFile),
								from: posix.basename(mapFile),
								sourcesContent: false
							}
						});
					} catch (err) {
						return handleError(this, err);
					}
					if (result.map) {
						this.emitFile({
							type: 'asset',
							fileName: mapFile,
							source: result.map.toString()
						});
					}
					asset.source = result.css;
				})
			);
		}
	};
}
@param {object} [options]
@param {boolean} [options.sourcemap = false]
@returns {import('rollup').Plugin}