Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80512 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
--no-browser-field, --no-bf
55
56
Turn off package.json browser field resolution. This is also handy if you
57
need to run a bundle in node.
58
59
--node
60
61
Alias for --bare and --no-browser-field.
62
63
--full-paths
64
65
Turn off converting module ids into numerical indexes. This is useful for
66
preserving the original paths that a bundle was generated with.
67
68
--deps
69
70
Instead of standard bundle output, print the dependency array generated by
71
module-deps.
72
73
--list
74
75
Print each file in the dependency graph. Useful for makefiles.
76
77
--extension=EXTENSION
78
79
Consider files with specified EXTENSION as modules, this option can used
80
multiple times.
81
82
--global-transform=MODULE, -g MODULE
83
84
Use a transform module on all files after any ordinary transforms have run.
85
86
--plugin=MODULE, -p MODULE
87
88
Register MODULE as a plugin.
89
90
Passing arguments to transforms and plugins:
91
92
For -t, -g, and -p, you may use subarg syntax to pass options to the
93
transforms or plugin function as the second parameter. For example:
94
95
-t [ foo -x 3 --beep ]
96
97
will call the `foo` transform for each applicable file by calling:
98
99
foo(file, { x: 3, beep: true })
100
101
102