vite-plugin-utils
Version:
A collection of opinionated Vite plugin utils
12 lines (8 loc) • 371 B
JavaScript
const fs = require('fs');
const path = require('path');
const code = fs.readFileSync(path.join(__dirname, 'bundle.cjs'), 'utf8');
const singlelineCommentsRE1 = /\/\/.*/g
const singlelineCommentsRE2 = /\/\/.*(?=[\n\r])/g
console.log(code.replace(singlelineCommentsRE1, '').length);
console.log(code.replace(singlelineCommentsRE2, '').length);
console.log(code.length);