You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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>
3490
3489
</td>
3491
3490
</tr>
3492
3491
<tr>
3493
3492
<tdclass="hdlist1">
3494
-
<code>:output-dir</code>
3493
+
<code>:entries</code>
3495
3494
</td>
3496
3495
<tdclass="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>
3499
3498
</td>
3500
3499
</tr>
3501
3500
</table>
3502
3501
</div>
3503
3502
<divclass="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
-
<divclass="paragraph">
3509
-
<p>Each entry will still result in a file with that namespace name in the specified output directory.</p>
3510
-
</div>
3511
-
<divclass="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>
3513
3504
</div>
3514
3505
<divclass="paragraph">
3515
-
<p>If you plan to distribute code on NPM, then you may want to use the
3516
-
<ahref="#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 <ahref="#NodeLibrary"><code>:node-library</code> target</a> instead since it allows for a finer level of control over exports and optimization.</p>
Copy file name to clipboardExpand all lines: docs/target-npm-module.adoc
+3-11Lines changed: 3 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -52,22 +52,14 @@ options are:
52
52
53
53
[horizontal]
54
54
`:target`:: Use :npm-module
55
+
`:output-dir`:: The path for supporting files in development mode.
55
56
`:entries`:: (optional) A vector of namespaces to include. Everything from these will be included.
56
57
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`.
59
58
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`.
63
59
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.
65
61
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.
0 commit comments