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
{{ message }}
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
Pass in options as the second argument to `browserify`:
58
34
59
35
```javascript
60
-
{
36
+
module.exports= (on) =>{
61
37
constoptions= {
62
38
// options here
63
-
};
39
+
}
64
40
65
-
on("file:preprocessor", browserify(options));
41
+
on('file:preprocessor', browserify(options))
66
42
}
67
43
```
68
44
@@ -74,10 +50,12 @@ Object of options passed to [browserify](https://github.com/browserify/browserif
74
50
// example
75
51
browserify({
76
52
browserifyOptions: {
77
-
extensions: [".js", ".ts"],
78
-
plugin: [["tsify"]],
79
-
},
80
-
});
53
+
extensions: ['.js', '.ts'],
54
+
plugin: [
55
+
['tsify']
56
+
]
57
+
}
58
+
})
81
59
```
82
60
83
61
If you pass one of the top-level options in (`extensions`, `transform`, etc), it will override the default. In the above example, browserify will process `.js` and `.ts` files, but not `.jsx` or `.coffee`. If you wish to add to or modify existing options, read about [modifying the default options](#modifying-default-options).
@@ -102,7 +80,7 @@ Source maps are always enabled unless explicitly disabled by specifying `debug:
102
80
ast:false,
103
81
babelrc:false,
104
82
plugins: [
105
-
'@babel/plugin-transform-modules-commonjs',
83
+
'@babel/plugin-transform-modules-commonjs',
106
84
'@babel/plugin-proposal-class-properties',
107
85
'@babel/plugin-proposal-object-rest-spread',
108
86
'@babel/plugin-transform-runtime',
@@ -121,7 +99,7 @@ Source maps are always enabled unless explicitly disabled by specifying `debug:
121
99
}
122
100
```
123
101
124
-
_Note_: `cache` and `packageCache` are always set to `{}` and cannot be overridden. Otherwise, file watching would not function correctly.
102
+
*Note*: `cache` and `packageCache` are always set to `{}` and cannot be overridden. Otherwise, file watching would not function correctly.
125
103
126
104
### watchifyOptions
127
105
@@ -131,9 +109,9 @@ Object of options passed to [watchify](https://github.com/browserify/watchify#op
131
109
// example
132
110
browserify({
133
111
watchifyOptions: {
134
-
delay:500,
135
-
},
136
-
});
112
+
delay:500
113
+
}
114
+
})
137
115
```
138
116
139
117
**Default**:
@@ -158,12 +136,12 @@ A function that is called with the [browserify instance](https://github.com/brow
158
136
```javascript
159
137
// example
160
138
browserify({
161
-
onBundle(bundle) {
162
-
bundle.external("react");
163
-
bundle.plugin("some-plugin");
164
-
bundle.ignore("pg-native");
165
-
},
166
-
});
139
+
onBundle(bundle) {
140
+
bundle.external('react')
141
+
bundle.plugin('some-plugin')
142
+
bundle.ignore('pg-native')
143
+
}
144
+
})
167
145
```
168
146
169
147
### typescript
@@ -172,8 +150,8 @@ When the path to the TypeScript package is given, Cypress will automatically tra
172
150
173
151
```javascript
174
152
browserify({
175
-
typescript:require.resolve("typescript"),
176
-
});
153
+
typescript:require.resolve('typescript')
154
+
})
177
155
```
178
156
179
157
**Default**: `undefined`
@@ -185,13 +163,13 @@ The default options are provided as `browserify.defaultOptions` so they can be m
185
163
If, for example, you want to update the options for the `babelify` transform to turn on `babelrc` loading, you could do the following:
0 commit comments