@@ -11,47 +11,3 @@ openGraphTitle: "deno bundle"
11
11
` deno bundle ` is currently an experimental subcommand and is subject to changes.
12
12
13
13
:::
14
-
15
- ` deno bundle [URL] ` will output a single JavaScript file for consumption in
16
- Deno, which includes all dependencies of the specified input. For example:
17
-
18
- ``` bash
19
- $ deno bundle https://deno.land/std@0.190.0/examples/colors.tsts colors.bundle.js
20
- Bundle https://deno.land/std@0.190.0/examples/colors.ts
21
- Download https://deno.land/std@0.190.0/examples/colors.ts
22
- Download https://deno.land/std@0.190.0/fmt/colors.ts
23
- Emit " colors.bundle.js" (9.83KB)
24
- ```
25
-
26
- If you omit the out file, the bundle will be sent to ` stdout ` .
27
-
28
- The bundle can just be run as any other module in Deno would:
29
-
30
- ``` bash
31
- deno run colors.bundle.js
32
- ```
33
-
34
- The output is a self contained ES Module, where any exports from the main module
35
- supplied on the command line will be available. For example, if the main module
36
- looked something like this:
37
-
38
- ``` ts
39
- export { foo } from " ./foo.js" ;
40
-
41
- export const bar = " bar" ;
42
- ```
43
-
44
- It could be imported like this:
45
-
46
- ``` ts
47
- import { bar , foo } from " ./lib.bundle.js" ;
48
- ```
49
-
50
- ## Bundling for the Web
51
-
52
- The output of ` deno bundle ` is intended for consumption in Deno and not for use
53
- in a web browser or other runtimes. That said, depending on the input it may
54
- work in other environments.
55
-
56
- If you wish to bundle for the web, we recommend other solutions such as
57
- [ esbuild] ( https://esbuild.github.io/ ) .
0 commit comments