All files / webpack-hot-socketio/lib fs.js

42.86% Statements 3/7
0% Branches 0/5
0% Functions 0/1
42.86% Lines 3/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181x 1x   1x                            
const path = require('path');
const MemoryFileSystem = require('memory-fs');
 
module.exports = function setFs(compiler) {
	if (
		typeof compiler.outputPath === 'string' &&
		!path.posix.isAbsolute(compiler.outputPath) &&
		!path.win32.isAbsolute(compiler.outputPath)
	) {
		throw new Error(
			'`output.path` needs to be an absolute path or `/`.'
		);
	}
 
	let fileSystem = new MemoryFileSystem();
	compiler.outputFileSystem = fileSystem;
};