UNPKG

vite-plugin-utils

Version:
12 lines (8 loc) 371 B
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);