Version: 0.0.01.0.01.0.12.0.02.0.13.0.03.1.03.1.13.1.24.0.04.1.04.1.14.2.04.3.04.3.14.3.24.4.04.4.14.4.24.4.34.4.44.5.04.5.15.0.05.0.15.0.26.0.06.0.17.0.07.0.17.0.27.0.37.1.07.2.07.2.17.2.27.3.07.4.07.4.17.4.27.5.07.6.07.6.17.6.27.6.37.7.07.7.18.0.08.0.18.0.28.1.08.1.18.1.28.1.38.1.48.1.58.2.08.3.08.4.09.0.09.0.19.0.29.0.39.0.49.1.09.1.19.2.010.0.011.0.011.0.111.1.111.1.211.1.312.0.013.0.013.1.013.1.113.1.213.1.313.1.413.1.513.1.613.1.713.2.013.2.113.2.213.2.313.2.413.2.513.2.613.2.713.3.013.3.113.3.213.3.313.3.413.3.513.3.613.3.713.4.013.4.113.4.213.4.313.5.013.5.113.5.214.0.015.0.015.0.115.0.215.0.315.0.415.1.015.1.115.2.015.3.015.3.115.3.215.3.315.4.015.4.115.4.215.4.315.4.415.4.515.4.616.0.016.0.116.0.216.0.317.0.018.0.018.0.119.0.019.0.119.1.019.1.119.1.219.2.019.2.119.2.219.2.319.2.419.2.519.2.619.2.720.0.020.1.020.1.120.1.220.2.020.2.120.2.220.2.320.2.420.2.521.0.021.0.121.0.221.0.321.1.021.2.021.2.121.3.021.4.021.5.022.0.022.1.0
'use strict';
// moves the last /**/ block to the top of the output
// assuming the source doesn't have any other /**/ blocks,
// this will be the header
// this is hackier than it should be, but gets the job done for now
export default function () {
return {
renderChunk(code) {
const pattern = /^(\/\*[\S\s]*?\*\/)$/gm;
const matches = code.match(pattern);
if (!matches) {
code: code
};
}
const header = matches[matches.length - 1];
code: `${header}\n${code.replace(header, '')}`