Skip to content

Commit

Permalink
fix(web,scripts): flat-web failed to startup in windows system (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 authored Oct 15, 2021
1 parent 3d4ed4a commit d2ab4a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/flat-web/scripts/react-virtualized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
/// <reference types="node" />

import fs from "fs";
import path from "path";

// eslint-disable-next-line @typescript-eslint/quotes
const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`;

const file = require
.resolve("react-virtualized")
.replace("dist/commonjs/index.js", "dist/es/WindowScroller/utils/onScroll.js");
.replace(
path.join("dist", "commonjs", "index.js"),
path.join("dist", "es", "WindowScroller", "utils", "onScroll.js"),
);
const code = fs.readFileSync(file, "utf-8");
const modified = code.replace(WRONG_CODE, "");
fs.writeFileSync(file, modified);
Expand Down

0 comments on commit d2ab4a5

Please sign in to comment.