-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node errors when not using r.js #2
Comments
Why not just use fs.readFileSync() when in node/not running via r.js? |
i'm sharing the same modules between the client and the server; and i'd prefer not to have to split logic between the two. thanks btw requirejs is literally my favorite lib ever. |
OK so you are just running the modules in node without using r.js, but just relying on amdefine? In that case it makes sense to get these changes in. If you already have the changes done and want to do a pull request that would be great. |
Hi, I'm using the jam.js version (2.0.0-jam.1) of the text plugin and I managed to get it working on the client and the server without modification using require.js for both sides. I just registered var requirejs = require('requirejs');
requirejs.config({
packages: [{
name: 'text',
location: '../path_to_scripts/jam/text',
main: 'text.js'
},
],
}); And use it in the follow statement. requirejs(['text!path_to_template'], function(template) {
console.log(template);
} |
I hit the same problem as catshirt. I made the same changes to text.js as he did, and that fixed the problem. Unfortunately, DragonDTG's solution didn't work. I also tried the stubModules functionality, couldn't get it to properly ignore the text module. |
I guess I am a bit lost on the use case. @JudahGabriel Maybe you can lay out the directories involved, how the text plugin is loaded/referenced. A small test case in a github repo would be ideal. |
i was able to get the text plugin working with requirejs as a node module, but it took a bit of modification. is the text plugin intended to work via node, without using r.js? if so, what could i be doing wrong? if not, what can we do to get real npm support?
below are errors and my resolutions...
The text was updated successfully, but these errors were encountered: