Skip to content

Commit 13b329b

Browse files
committed
Small doc changes for node page.
1 parent 094796d commit 13b329b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

docs/node.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,18 @@ <h2>
4343
<li>Otherwise the module is assumed to be relative to the file that is given to Node to start your app.</li>
4444
</ul>
4545

46-
<p>You can always use the <a href="api.html#config">Configuration Options</a> for RequireJS in your top level app file to configure paths and even a different baseUrl for your modules.</p>
46+
<p>What this means in practice: you cannot use packages installed by npm and assume RequireJS will find them. This may change in the future though.</p>
47+
48+
<p>You can use the <a href="api.html#config">Configuration Options</a> for RequireJS in your top level app file to configure paths, package pages, and even a different baseUrl for your modules.</p>
49+
50+
<p>So if you configure that package paths to the locations where npm installs modules, then the r.js adapter will be able to load them.</p>
4751

4852
<p>RequireJS does not support require.main and the module free variable only contains an <strong>id</strong> property. It does not define a require.async method, since require() in RequireJS can accept roughly equivalent arguments.</p>
4953

5054
<p>Even though RequireJS is an asynchronous loader in the browser, the RequireJS Node adapter loads modules synchronously in the Node environment. This was done to make the adapter easier to code. The adapter could be made asynchronous, but the primary benefit of RequireJS integration with Node is to allow you to write modules in the same format on the server and for the browser.</p>
5155

5256
<p>Finally, RequireJS in Node can only load modules that are on the local disk -- fetching modules across http, for instance, is not supported at this time.</p>
5357

54-
<p>For RequireJS features: the text plugin does not work in Node at the moment, but that should be fixed by the next RequireJS release.</p>
5558
</div>
5659

5760
<div class="section">
@@ -76,7 +79,7 @@ <h2>
7679
<pre><code>node path/to/r.js debug myNodeApp.js
7780
</code></pre>
7881

79-
<p>Node integration is a relatively new feature, so I expect the conversion process may not work for all modules, and in particular, RequireJS has a different approach to circular dependencies than normal CommonJS modules.</p>
82+
<p>Node integration is a relatively new feature, so I expect the conversion process may not work for all modules.</p>
8083

8184
<p>If you find you have a problem, and want to report it, use the <a href="http://github.com/jrburke/requirejs/issues">RequireJS GitHub Issues page</a>. If you can attach the output of the <strong>debug</strong> run, that would be helpful, <strong>but be forewarned</strong>, it is very verbose and prints out all the source code.</p>
8285

0 commit comments

Comments
 (0)