Open IanVS opened 9 years ago
Browserify is picky about where your tmp folder lives relative to your node_modules folder. If you can mount the actual ramdisk at your-app/tmp instead of just symlinking it, that would probably solve this. Alternatively, you could try symlinking your node_modules folder into the real ramdisk location, so that code being built there can find it via normal node rules.
@ef4, moving node_modules to /mnt/EmberCliRamdisk/
I think I'll just move my Ember project folders to my HDD and avoid the hassle. Thanks for explaining the cause.
@ef4 we have plans to move the tmp folder outside of the project. We will likely need to fixup how ember-browserify works for that. Can we inform browserify of the correct node_modules root/package.json to review?
As far as I know it's not easy. browserify is trying hard to maintain normal node semantics. node is really picky about only using the node_modules hierarchy.
So I think the right thing to make sure that the project's node_modules is available within the build tree that gets passed to browserify. A symlink should suffice.
@ef4 if symlink works, then fantastic. But does leave our windows friends in a bad spot.
I wonder if we can bend substacks arm
It worked for me with symlinking node_modules. How would this work for multiple projects if tmp and node_modules both live outside the project folder? I like that ember-cli is self contained as it is now.
node_modules will remain in the project, tmp will not. It is a hazard for editors and other tools watching `tmp/*
@ef4 this will also break with broccoli v1, one thing we could do is make a custom browserify-tmp dir in the project root, thoughts?
This will actually need to be revisited, when broccoli 1.0 happens and tmp moves to system tmp. The solution is to symlink (and junction for our windows friends) in node_modules to the basedir of browserify.
I created an issue at ember-cli-ramdisk [https://github.com/ExpressCheckout/ember-cli-ramdisk/issues/8], but thought you might like to know about this as well. When using that addon, I am unable to import modules. For example if I try to
import moment from 'npm:moment';
I get the error:I have no idea what the actual problem is, which is why I brought it up in both repos.