super-productivity/tools/remove-woff.js
Johannes Millan 60203003f0 fix(build): update glob API and remove unused Angular imports
Use globSync instead of callback-based glob (breaking change in glob v9+).
Remove unused MatHint and AsyncPipe imports to fix NG8113 warnings.
2026-02-04 18:30:51 +01:00

23 lines
916 B
JavaScript

/* eslint-env es6 */
const { globSync } = require('glob');
const fs = require('fs');
// "removeWOFF2": "find dist/ -type f -iname '*.woff' -delete && find dist/ -type f -iname '*.css' -exec sed -i \"s/, url\\('.*'\\) format\\('woff'\\)//g\" {} \\;",
const files = globSync('dist/*.woff');
files.forEach((filePath) => {
fs.unlinkSync(filePath);
});
// NOTE: this would remove the dead references, but it should be no problem anyway
// glob('dist/*.css', function (er, files) {
// files.forEach((filePath) => {
// const fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
// const newFileContent = fileContent
// .replace(/,url\(.*\) format\('woff'\)/g, '')
// .replace(/,url\(.*\) format\("woff"\)/g, '')
// .replace(/url\(.*\) format\('woff'\)/g, '')
// .replace(/url\(.*\) format\("woff"\)/g, '');
// fs.writeFileSync(filePath, newFileContent);
// });
// });