Skip to content

Commit

Permalink
fix(vue-cli-plugin-image-modernizer): add fs.rmSync polyfill to suppo…
Browse files Browse the repository at this point in the history
…rt node@<14 (#75)

* Fix: Add rmSync polyfill

* Update rmSync-polyfill.ts

Co-authored-by: Calvin Liang <me@calvin.sh>
  • Loading branch information
EgorFront and Calvin-LL committed Jun 29, 2021
1 parent 1a2e383 commit fd0f5c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vue-cli-plugin-image-modernizer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "fs";
import './rmSync-polyfill.ts'
import mime from "mime";
import path from "path";
import { Compiler, Plugin, loader } from "webpack";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import fs from "fs";

if (!fs.rmSync) {
const rimraf = require("rimraf");
fs.rmSync = (path: fs.PathLike) => {
return rimraf.sync(path);
};
}

0 comments on commit fd0f5c8

Please sign in to comment.