UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

20 lines (17 loc) 452 B
import { readFileSync, writeFileSync } from '../fs/fs.mjs'; import { transFormRem } from '../rem/rem.mjs'; import 'fs'; /** * 替换文件的 rem 单位,转为 px * @param {string} filePath 文件路径 * @example * ```ts * remToPxInFile('xxx.vue'); * ``` */ function remToPxInFile(filePath) { var data = readFileSync(filePath); var newData = transFormRem(data, 50, 'px'); writeFileSync(filePath, newData); } export { remToPxInFile };