Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81146 views
1
Advanced Options:
2
3
--insert-globals, --ig, --fast [default: false]
4
5
Skip detection and always insert definitions for process, global,
6
__filename, and __dirname.
7
8
benefit: faster builds
9
cost: extra bytes
10
11
--insert-global-vars, --igv
12
13
Comma-separated list of global variables to detect and define.
14
Default: __filename,__dirname,process,Buffer,global
15
16
--detect-globals, --dg [default: true]
17
18
Detect the presence of process, global, __filename, and __dirname and define
19
these values when present.
20
21
benefit: npm modules more likely to work
22
cost: slower builds
23
24
--ignore-missing, --im [default: false]
25
26
Ignore `require()` statements that don't resolve to anything.
27
28
--noparse=FILE
29
30
Don't parse FILE at all. This will make bundling much, much faster for giant
31
libs like jquery or threejs.
32
33
--no-builtins
34
35
Turn off builtins. This is handy when you want to run a bundle in node which
36
provides the core builtins.
37
38
--no-commondir
39
40
Turn off setting a commondir. This is useful if you want to preserve the
41
original paths that a bundle was generated with.
42
43
--no-bundle-external
44
45
Turn off bundling of all external modules. This is useful if you only want
46
to bundle your local files.
47
48
--bare
49
50
Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars
51
to just "__filename,__dirname". This is handy if you want to run bundles in
52
node.
53
54
--full-paths
55
56
Turn off converting module ids into numerical indexes. This is useful for
57
preserving the original paths that a bundle was generated with.
58
59
--deps
60
61
Instead of standard bundle output, print the dependency array generated by
62
module-deps.
63
64
--list
65
66
Print each file in the dependency graph. Useful for makefiles.
67
68
--extension=EXTENSION
69
70
Consider files with specified EXTENSION as modules, this option can used
71
multiple times.
72
73
--global-transform=MODULE, --g MODULE
74
75
Use a transform module on all files after any ordinary transforms have run.
76
77
--plugin=MODULE, -p MODULE
78
79
Register MODULE as a plugin.
80
81
Passing arguments to transforms and plugins:
82
83
For -t, -g, and -p, you may use subarg syntax to pass options to the
84
transforms or plugin function as the second parameter. For example:
85
86
-t [ foo -x 3 --beep ]
87
88
will call the `foo` transform for each applicable file by calling:
89
90
foo(file, { x: 3, beep: true })
91
92
93