I'm try to use simple-json-loader
. I install this from npm and write following function:
onclickExport() {
var loader = require('simple-json-loader');
var json = loader.JSONLoader.loadFromFile('wwwroot/dist/data/files.json');
}
Еverything seems simple, but when I run build in webback i see following error:
ERROR in ./~/simple-json-loader/index.js Module not found: Error: Cannot resolve module 'fs' in D:\GitRepo\Magazine\Magazine.Web\node_modules\simple-json-loader @ ./~/simple-json-loader/index.js
Npm package is in the node_modules by valid path. I see it there. Also In debugging of this function i see analogous error. Is any ideas why it is not work?