Closed barisnisanci closed 8 years ago
You can only import modules that are directly available from the projects node_modules folder, which means you can't import core node modules. In other words, you can only import modules declared in package.json.
You could try finding a file operation library for the browser and import that.
Problem is nodejs fs is like a base component that every filesystem package expands it. Rewrting that module would be unnecessary. It would be better to be able to reach that.
Node's fs
library is specifically written for a server. What the browser can do with the filesystem is fundamentally different and far more limited than what you can do on the server. That being said, someone has already done a port of fs for the browser. You could try using that and then remap the module id using the browserify configs.
Anyways, ember-browserify
is just a wrapper around browserify
, we can try and support whatever browserify
supports, but we have no plans to go beyond that.
Edit: Grammar
Can't use any npm package that requires nodejs core modules like
require('fs')
. Gives this error:Uncaught Error: Could not find module fs
Am I missing something or is there a way to use nodejs core modules?