Files
Hydro/tool/changeRegistry.js
T
undefined 8f6968bbbd 简化模块加载
deprecated hydro-build
2020-07-15 20:46:45 +08:00

12 lines
380 B
JavaScript

const fs = require('fs');
const path = require('path');
function fix(file) {
let content = fs.readFileSync(file).toString();
content = content.replace(/https:\/\/registry.yarnpkg.com\//gmi, 'https://registry.npm.taobao.org/');
fs.writeFileSync(file, content);
}
fix(path.resolve(__dirname, '..', 'yarn.lock'));
fix(path.resolve(__dirname, '..', 'ui', 'yarn.lock'));