2019-09-06 19:25:17 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const fs = require("fs");
|
|
|
|
const { resolve } = require("path");
|
|
|
|
|
|
|
|
const sourceEthers = fs.readFileSync(resolve(__dirname, "../../packages/ethers/src.ts/ethers.ts")).toString();
|
|
|
|
const targets = sourceEthers.match(/export\s*{\s*((.|\s)*)}/)[1].trim();
|
|
|
|
|
|
|
|
const output = `"use strict";
|
|
|
|
|
2019-11-23 15:38:13 +03:00
|
|
|
// To modify this file, you must update ./admin/cmds/update-exports.js
|
|
|
|
|
2019-09-06 19:25:17 +03:00
|
|
|
import * as ethers from "./ethers";
|
|
|
|
|
2019-11-23 15:38:13 +03:00
|
|
|
if ((<any>global)._ethers == null) {
|
|
|
|
(<any>global)._ethers = ethers;
|
|
|
|
}
|
|
|
|
|
2019-09-06 19:25:17 +03:00
|
|
|
export { ethers };
|
|
|
|
|
|
|
|
export {
|
|
|
|
${ targets }
|
|
|
|
} from "./ethers";
|
|
|
|
`;
|
|
|
|
|
|
|
|
fs.writeFileSync(resolve(__dirname, "../../packages/ethers/src.ts/index.ts"), output);
|