mirror of
https://github.com/certd/certd.git
synced 2026-07-21 18:37:33 +08:00
chore: format
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
import fs from 'fs';
|
||||
import fs from "fs";
|
||||
//瘦身
|
||||
const filePath = './node_modules/typeorm/platform/PlatformTools.js';
|
||||
const filePath = "./node_modules/typeorm/platform/PlatformTools.js";
|
||||
const find = `const cli_highlight_1 = require("cli-highlight");`;
|
||||
const rep = 'const cli_highlight_1 ={highlight: (str) => { return str }};';
|
||||
const rep = "const cli_highlight_1 ={highlight: (str) => { return str }};";
|
||||
|
||||
// 在 filePath 找到 find那一行 用 rep 替换
|
||||
function slimming(filePath, find, rep) {
|
||||
fs.readFile(filePath, 'utf8', function (err, data) {
|
||||
fs.readFile(filePath, "utf8", function (err, data) {
|
||||
if (err) {
|
||||
return console.log(err);
|
||||
}
|
||||
var result = data.replace(find, rep);
|
||||
fs.writeFile(filePath, result, 'utf8', function (err) {
|
||||
fs.writeFile(filePath, result, "utf8", function (err) {
|
||||
if (err) return console.log(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
slimming(filePath, find, rep);
|
||||
|
||||
slimming("./tsconfig.json",`"sourceMap": true,`, `"sourceMap": false,`)
|
||||
slimming("./tsconfig.json",`"inlineSourceMap": true,`, `"inlineSourceMap": false,`)
|
||||
slimming("./tsconfig.json", `"sourceMap": true,`, `"sourceMap": false,`);
|
||||
slimming("./tsconfig.json", `"inlineSourceMap": true,`, `"inlineSourceMap": false,`);
|
||||
|
||||
Reference in New Issue
Block a user