Skip to content

Commit 6800e11

Browse files
committed
fix npm-module docs
1 parent 5b370ce commit 6800e11

File tree

2 files changed

+10
-29
lines changed

2 files changed

+10
-29
lines changed

docs/UsersGuide.html

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3482,39 +3482,28 @@ <h3 id="_explicit_configuration"><a class="anchor" href="#_explicit_configuratio
34823482
</tr>
34833483
<tr>
34843484
<td class="hdlist1">
3485-
<code>:entries</code>
3485+
<code>:output-dir</code>
34863486
</td>
34873487
<td class="hdlist2">
3488-
<p>(optional) A vector of namespaces to include. Everything from these will be included.
3489-
Defaults to everything it can find.</p>
3488+
<p>The path for supporting files in development mode.</p>
34903489
</td>
34913490
</tr>
34923491
<tr>
34933492
<td class="hdlist1">
3494-
<code>:output-dir</code>
3493+
<code>:entries</code>
34953494
</td>
34963495
<td class="hdlist2">
3497-
<p>(optional). The path for supporting files in development mode. Defaults to
3498-
<code>node_modules/shadow-cljs</code>.</p>
3496+
<p>(optional) A vector of namespaces to include. Everything from these will be included.
3497+
Defaults to everything it can find.</p>
34993498
</td>
35003499
</tr>
35013500
</table>
35023501
</div>
35033502
<div class="paragraph">
3504-
<p>The <code>:entries</code> setting can be used to limit what things get included, and the <code>:output-dir</code> is
3505-
particularly useful for naming the directory in <code>node_modules</code> so that you can
3506-
customize what name you use with <code>require</code>.</p>
3507-
</div>
3508-
<div class="paragraph">
3509-
<p>Each entry will still result in a file with that namespace name in the specified output directory.</p>
3510-
</div>
3511-
<div class="paragraph">
3512-
<p>Of course all of this is generated with standard Node conventions.</p>
3503+
<p>If you use an <code>:output-dir</code> like <code>"node_modules/shadow-cljs"</code> you can access them by using <code>require("shadow-cljs/demo.foo")</code>. When using something not in <code>node_modules</code> you must include them using a relative path. With <code>:output-dir "out"</code> that would be <code>require("./out/demo.foo")</code> from your project root.</p>
35133504
</div>
35143505
<div class="paragraph">
3515-
<p>If you plan to distribute code on NPM, then you may want to use the
3516-
<a href="#NodeLibrary"><code>:node-library</code> target</a> instead since it allows for a finer level of control
3517-
over exports and optimization.</p>
3506+
<p>If you plan to distribute code on NPM, then you may want to use the <a href="#NodeLibrary"><code>:node-library</code> target</a> instead since it allows for a finer level of control over exports and optimization.</p>
35183507
</div>
35193508
</div>
35203509
<div class="sect2">

docs/target-npm-module.adoc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,14 @@ options are:
5252

5353
[horizontal]
5454
`:target`:: Use :npm-module
55+
`:output-dir`:: The path for supporting files in development mode.
5556
`:entries`:: (optional) A vector of namespaces to include. Everything from these will be included.
5657
Defaults to everything it can find.
57-
`:output-dir`:: (optional). The path for supporting files in development mode. Defaults to
58-
`node_modules/shadow-cljs`.
5958

60-
The `:entries` setting can be used to limit what things get included, and the `:output-dir` is
61-
particularly useful for naming the directory in `node_modules` so that you can
62-
customize what name you use with `require`.
6359

64-
Each entry will still result in a file with that namespace name in the specified output directory.
60+
If you use an `:output-dir` like `"node_modules/shadow-cljs"` you can access them by using `require("shadow-cljs/demo.foo")`. When using something not in `node_modules` you must include them using a relative path. With `:output-dir "out"` that would be `require("./out/demo.foo")` from your project root.
6561

66-
Of course all of this is generated with standard Node conventions.
67-
68-
If you plan to distribute code on NPM, then you may want to use the
69-
<<NodeLibrary, `:node-library` target>> instead since it allows for a finer level of control
70-
over exports and optimization.
62+
If you plan to distribute code on NPM, then you may want to use the <<NodeLibrary, `:node-library` target>> instead since it allows for a finer level of control over exports and optimization.
7163

7264
== Working with Optimizations
7365

0 commit comments

Comments
 (0)