Skip to content

Commit

Permalink
fix: make work in Webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Dalecky authored and Vadim Dalecky committed Nov 9, 2017
1 parent d5fbb37 commit a162520
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "memfs",
"version": "2.5.7",
"version": "2.5.8",
"description": "In-memory file-system with Node's fs API.",
"main": "lib/index.js",
"keywords": [
Expand Down
16 changes: 14 additions & 2 deletions src/volume.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {posix, resolve as resolveCrossPlatform} from 'path';
const {sep, relative} = posix;
import {resolve as resolveCrossPlatform} from 'path';
import * as pathModule from 'path';
import {Node, Link, File, Stats} from "./node";
import {Buffer} from 'buffer';
import setImmediate from './setImmediate';
Expand All @@ -17,6 +17,18 @@ const {O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
F_OK, R_OK, W_OK, X_OK} = constants;


let sep, relative;
if (pathModule.posix) {
const posix = pathModule;

sep = posix.sep;
relative = posix.relative;
} else {
sep = pathModule.sep;
relative = pathModule.relative;
}


const isWin = process.platform === 'win32';

// ---------------------------------------- Types
Expand Down

0 comments on commit a162520

Please sign in to comment.