| 
									
										
										
										
											2023-01-03 11:55:46 -08:00
										 |  |  | // Copyright 2019 Signal Messenger, LLC
 | 
					
						
							| 
									
										
										
										
											2020-10-30 15:34:04 -05:00
										 |  |  | // SPDX-License-Identifier: AGPL-3.0-only
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-17 15:25:57 -05:00
										 |  |  | module.exports = { | 
					
						
							|  |  |  |   presets: ['@babel/preset-react', '@babel/preset-typescript'], | 
					
						
							| 
									
										
										
										
											2020-02-07 14:07:22 -05:00
										 |  |  |   // Detects the type of file being babel'd (either esmodule or commonjs)
 | 
					
						
							|  |  |  |   sourceType: 'unambiguous', | 
					
						
							| 
									
										
										
										
											2019-12-17 15:25:57 -05:00
										 |  |  |   plugins: [ | 
					
						
							|  |  |  |     'react-hot-loader/babel', | 
					
						
							|  |  |  |     'lodash', | 
					
						
							| 
									
										
										
										
											2021-12-15 12:08:04 -06:00
										 |  |  |     '@babel/plugin-transform-typescript', | 
					
						
							| 
									
										
										
										
											2019-12-17 15:25:57 -05:00
										 |  |  |     '@babel/plugin-proposal-class-properties', | 
					
						
							| 
									
										
										
										
											2021-03-11 14:36:31 -06:00
										 |  |  |     '@babel/plugin-proposal-optional-chaining', | 
					
						
							| 
									
										
										
										
											2021-09-03 16:39:46 -05:00
										 |  |  |     '@babel/plugin-proposal-nullish-coalescing-operator', | 
					
						
							| 
									
										
										
										
											2020-02-07 14:07:22 -05:00
										 |  |  |     // This plugin converts commonjs to esmodules which is required for
 | 
					
						
							|  |  |  |     // importing commonjs modules from esmodules in storybook. As a part of
 | 
					
						
							|  |  |  |     // converting to TypeScript we should use esmodules and can eventually
 | 
					
						
							|  |  |  |     // remove this plugin
 | 
					
						
							|  |  |  |     process.env.SIGNAL_ENV === 'storybook' && '@babel/transform-runtime', | 
					
						
							|  |  |  |   ].filter(Boolean), | 
					
						
							| 
									
										
										
										
											2019-12-17 15:25:57 -05:00
										 |  |  | }; |