File: browserify.1

package info (click to toggle)
node-browserify 17.0.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,400 kB
  • sloc: javascript: 5,642; makefile: 27; sh: 10
file content (173 lines) | stat: -rw-r--r-- 5,089 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
.TH BROWSERIFY "1" "September 2021" "browserify 17.0.0" "browserify"
.SH NAME
browserify \- browserify Node.js sources
.SH SYNOPSIS
.B browserify
[\fI\,entry files\/\fR] \fI\,{OPTIONS}\/\fR
.SH DESCRIPTION
Browsers don't have the require method defined, but Node.js does. With Browserify you can write code that uses require in the same way that you would use it in Node.
.SH OPTIONS
.SS Standard Options:
.TP
\fB\-\-outfile\fR, \fB\-o\fR
Write the browserify bundle to this file.
If unspecified, browserify prints to stdout.
.TP
\fB\-\-require\fR, \fB\-r\fR
A module name or file to bundle.require()
Optionally use a colon separator to set the target.
.TP
\fB\-\-entry\fR, \fB\-e\fR
An entry point of your app
.TP
\fB\-\-ignore\fR, \fB\-i\fR
Replace a file with an empty stub. Files can be globs.
.TP
\fB\-\-exclude\fR, \fB\-u\fR
Omit a file from the output bundle. Files can be globs.
.TP
\fB\-\-external\fR, \fB\-x\fR
Reference a file from another bundle. Files can be globs.
.TP
\fB\-\-transform\fR, \fB\-t\fR
Use a transform module on top\-level files.
.TP
\fB\-\-command\fR, \fB\-c\fR
Use a transform command on top\-level files.
.TP
\fB\-\-standalone\fR \fB\-s\fR
Generate a UMD bundle for the supplied export name.
This bundle works with other module systems and sets the name
given as a window global if no module system is found.
.TP
\fB\-\-debug\fR \fB\-d\fR
Enable source maps that allow you to debug your files
separately.
.TP
\fB\-\-help\fR, \fB\-h\fR
Show this message
.PP
For advanced options, type `browserify \fB\-\-help\fR advanced`.
.PP
Specify a parameter.
.SS Advanced Options
.TP
\fB\-\-insert\-globals\fR, \fB\-\-ig\fR, \fB\-\-fast\fR
[default: false]
.IP
Skip detection and always insert definitions for process, global,
__filename, and __dirname.
.IP
benefit: faster builds
cost: extra bytes
.HP
\fB\-\-insert\-global\-vars\fR, \fB\-\-igv\fR
.IP
Comma\-separated list of global variables to detect and define.
Default: __filename,__dirname,process,Buffer,global
.TP
\fB\-\-detect\-globals\fR, \fB\-\-dg\fR
[default: true]
.IP
Detect the presence of process, global, __filename, and __dirname and define
these values when present.
.IP
benefit: npm modules more likely to work
cost: slower builds
.TP
\fB\-\-ignore\-missing\fR, \fB\-\-im\fR
[default: false]
.IP
Ignore `require()` statements that don't resolve to anything.
.HP
\fB\-\-noparse\fR=\fI\,FILE\/\fR
.IP
Don't parse FILE at all. This will make bundling much, much faster for giant
libs like jquery or threejs.
.HP
\fB\-\-no\-builtins\fR
.IP
Turn off builtins. This is handy when you want to run a bundle in node which
provides the core builtins.
.HP
\fB\-\-no\-commondir\fR
.IP
Turn off setting a commondir. This is useful if you want to preserve the
original paths that a bundle was generated with.
.HP
\fB\-\-no\-bundle\-external\fR
.IP
Turn off bundling of all external modules. This is useful if you only want
to bundle your local files.
.HP
\fB\-\-bare\fR
.IP
Alias for both \fB\-\-no\-builtins\fR, \fB\-\-no\-commondir\fR, and sets \fB\-\-insert\-global\-vars\fR
to just "__filename,__dirname". This is handy if you want to run bundles in
node.
.HP
\fB\-\-no\-browser\-field\fR, \fB\-\-no\-bf\fR
.IP
Turn off package.json browser field resolution. This is also handy if you
need to run a bundle in node.
.HP
\fB\-\-transform\-key\fR
.IP
Instead of the default package.json#browserify#transform field to list
all transforms to apply when running browserify, a custom field, like, e.g.
package.json#browserify#production or package.json#browserify#staging
can be used, by for example running:
* `browserify index.js \fB\-\-transform\-key\fR=\fI\,production\/\fR > bundle.js`
* `browserify index.js \fB\-\-transform\-key\fR=\fI\,staging\/\fR > bundle.js`
.HP
\fB\-\-node\fR
.IP
Alias for \fB\-\-bare\fR and \fB\-\-no\-browser\-field\fR.
.HP
\fB\-\-full\-paths\fR
.IP
Turn off converting module ids into numerical indexes. This is useful for
preserving the original paths that a bundle was generated with.
.HP
\fB\-\-deps\fR
.IP
Instead of standard bundle output, print the dependency array generated by
module\-deps.
.HP
\fB\-\-no\-dedupe\fR
.IP
Turn off deduping.
.HP
\fB\-\-list\fR
.IP
Print each file in the dependency graph. Useful for makefiles.
.HP
\fB\-\-extension\fR=\fI\,EXTENSION\/\fR
.IP
Consider files with specified EXTENSION as modules, this option can used
multiple times.
.HP
\fB\-\-global\-transform\fR=\fI\,MODULE\/\fR, \fB\-g\fR MODULE
.IP
Use a transform module on all files after any ordinary transforms have run.
.HP
\fB\-\-plugin\fR=\fI\,MODULE\/\fR, \fB\-p\fR MODULE
.IP
Register MODULE as a plugin.
.HP
\fB\-\-preserve\-symlinks\fR
.IP
Preserves symlinks when resolving modules.
.PP
Passing arguments to transforms and plugins:
.IP
For \fB\-t\fR, \fB\-g\fR, and \fB\-p\fR, you may use subarg syntax to pass options to the
transforms or plugin function as the second parameter. For example:
.HP
\fB\-t\fR [ foo \fB\-x\fR 3 \fB\-\-beep\fR ]
.IP
will call the `foo` transform for each applicable file by calling:
.IP
foo(file, { x: 3, beep: true })
.SH "SEE ALSO"
browser-pack(1)