Skip to content

Commit

Permalink
Make VirtualStats compatible with Node 6-14 (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrestov authored Sep 4, 2020
1 parent 1104fe7 commit 2773097
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/virtual.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,24 @@ function VirtualModulesPlugin(compiler) {

VirtualModulesPlugin.prototype.writeModule = function(filePath, contents) {
var len = contents ? contents.length : 0;
var time = Date.now();
var time = new Date();
var timeMs = time.getTime();

var stats = new VirtualStats({
dev: 8675309,
ino: inode++,
mode: 33188,
nlink: 0,
uid: 1000,
gid: 1000,
rdev: 0,
blksize: 4096,
ino: inode++,
mode: 33188,
size: len,
blksize: 4096,
blocks: Math.floor(len / 4096),
atimeMs: timeMs,
mtimeMs: timeMs,
ctimeMs: timeMs,
birthtimeMs: timeMs,
atime: time,
mtime: time,
ctime: time,
Expand Down

0 comments on commit 2773097

Please sign in to comment.