File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
polyfills/@mongodb-js/saslprep Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ export function saslprep ( ) : void {
2+ throw new Error ( 'saslprep is not supported in this environment' ) ;
3+ }
Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ module.exports = (env, args) => {
4545 '@mongodb-js/devtools-proxy-support'
4646 ) ,
4747
48+ ...( config . mode === 'production'
49+ ? {
50+ // We don't need saslprep in the product web bundle, as we don't use scram auth there.
51+ // We use a local polyfill for the driver to avoid having it in the bundle
52+ // as it is a decent size. We do use scram auth in tests and local
53+ // development, so we want it there.
54+ '@mongodb-js/saslprep' : localPolyfill ( '@mongodb-js/saslprep' ) ,
55+ }
56+ : { } ) ,
57+
4858 // Replace 'devtools-connect' with a package that just directly connects
4959 // using the driver (= web-compatible driver) logic, because devtools-connect
5060 // contains a lot of logic that makes sense in a desktop application/CLI but
@@ -218,7 +228,7 @@ module.exports = (env, args) => {
218228 'react-dom' : 'commonjs2 react-dom' ,
219229
220230 // TODO(CLOUDP-228421): move Socket implementation from mms codebase when
221- // active work on the connumicatino protocol is wrapped up
231+ // active work on the communication protocol is wrapped up
222232 tls : 'commonjs2 tls' ,
223233 } ,
224234 plugins : [
You can’t perform that action at this time.
0 commit comments