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