code: function stylesheet(config = {}) {
  	const minifier = new cleancss();
  	const styles = [];
  
  	return {
  		name: 'stylesheet',
  		transform(code, id) {
  			// Note that 'id' can be mapped to a CJS proxy import, in which case
  			// 'id' will start with 'commonjs-proxy', so let's first check if we
  			// are importing an existing css file (i.e. startsWith()).
  			if (!id.startsWith(path.resolve('.')) || !id.endsWith('.css')) {
  				return;
  			}
  
  			if (config.minify) {
  				code = minifier.minify(code).styles;
  			}
  
  			// keep track of all imported stylesheets (already minified)
  			styles.push(code);
  
  			return {
  				code: 'export default ' + JSON.stringify(code)
  			};
  		},
  		generateBundle(opts, bundle) {
  			if (!config.extract) {
  				return;
  			}
  
  			const entry = Object.keys(bundle).find(v => bundle[v].isEntry);
  			const name = (entry || '').replace(/\.js$/i, '.css');
  			if (!name) {
  				this.error('failed to guess the output file name');
  			}
  
  			bundle[name] = {
  				code: styles.filter(v => !!v).join('')
  			};
  		}
  	};
  }
docs: https://github.com/chartjs/Chart.js/issues/5208