babel-plugin-static-fs icon indicating copy to clipboard operation
babel-plugin-static-fs copied to clipboard

Does not work with __coverage__ or istanbul

Open z-vr opened this issue 7 years ago • 2 comments

I get this error

Error: file.js: Could not statically evaluate how the fs module was required/imported. while parsing file: file.js

When trying to use static-fs with either babel-plugin-static-fs or babel-plugin-istanbul

z-vr avatar Jul 18 '17 16:07 z-vr

i think because the instrumentation does

var fs = (++_cover__().s['2'], require('fs'));

z-vr avatar Jul 18 '17 16:07 z-vr

I've figured it out, one has to add

/* istanbul ignore next */
const path = require('path');
/* istanbul ignore next */
const fs = require('fs');

for babel-plugin-istanbul in order for both plugins to work together. hope that helps.

z-vr avatar Jul 18 '17 17:07 z-vr