#!/usr/bin/env node const path = require("path"); const fs = require("fs"); const { spawn } = require("child_process"); const parseFile = function (path) { console.log("fix start") if (!fs.existsSync(path)) { return; } console.log("content") let content = JSON.parse(fs.readFileSync(path, "utf8")); content.name = "wechat_devtools"; // 开启调试,更新参数 content['chromium-args'] = content['chromium-args'].replace('--disable-devtools', '').replace('--ignore-gpu-blacklist', '--ignore-gpu-blocklist') + ' --mixed-context' console.log("arite") fs.writeFileSync(path, JSON.stringify(content, null, 4)); }; parseFile(path.resolve(__dirname, "../package.nw/package.json")); parseFile(path.resolve(__dirname, "../package.nw/package-lock.json"));