| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Copyright (c) Microsoft Corporation. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
					
						
							|  |  |  |  * you may not use this file except in compliance with the License. | 
					
						
							|  |  |  |  * You may obtain a copy of the License at | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Unless required by applicable law or agreed to in writing, software | 
					
						
							|  |  |  |  * distributed under the License is distributed on an "AS IS" BASIS, | 
					
						
							|  |  |  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
					
						
							|  |  |  |  * See the License for the specific language governing permissions and | 
					
						
							|  |  |  |  * limitations under the License. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { defineConfig } from 'vite'; | 
					
						
							|  |  |  | import react from '@vitejs/plugin-react'; | 
					
						
							| 
									
										
										
										
											2022-06-16 15:18:25 -08:00
										 |  |  | import { bundle } from './bundle'; | 
					
						
							| 
									
										
										
										
											2024-07-10 22:32:08 +02:00
										 |  |  | import path from 'path'; | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // https://vitejs.dev/config/
 | 
					
						
							|  |  |  | export default defineConfig({ | 
					
						
							| 
									
										
										
										
											2022-04-04 20:53:19 -08:00
										 |  |  |   base: '', | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |   plugins: [ | 
					
						
							| 
									
										
										
										
											2022-06-16 15:18:25 -08:00
										 |  |  |     react(), | 
					
						
							|  |  |  |     bundle() | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |   ], | 
					
						
							|  |  |  |   resolve: { | 
					
						
							|  |  |  |     alias: { | 
					
						
							| 
									
										
										
										
											2023-02-17 11:19:53 -08:00
										 |  |  |       '@injected': path.resolve(__dirname, '../playwright-core/src/server/injected'), | 
					
						
							| 
									
										
										
										
											2023-03-06 18:49:14 -08:00
										 |  |  |       '@isomorphic': path.resolve(__dirname, '../playwright-core/src/utils/isomorphic'), | 
					
						
							| 
									
										
										
										
											2022-09-20 18:41:51 -07:00
										 |  |  |       '@protocol': path.resolve(__dirname, '../protocol/src'), | 
					
						
							| 
									
										
										
										
											2023-09-08 14:23:35 -07:00
										 |  |  |       '@testIsomorphic': path.resolve(__dirname, '../playwright/src/isomorphic'), | 
					
						
							| 
									
										
										
										
											2023-03-01 15:27:23 -08:00
										 |  |  |       '@trace': path.resolve(__dirname, '../trace/src'), | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |       '@web': path.resolve(__dirname, '../web/src'), | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   build: { | 
					
						
							| 
									
										
										
										
											2023-08-19 16:16:44 -07:00
										 |  |  |     outDir: path.resolve(__dirname, '../playwright-core/lib/vite/traceViewer'), | 
					
						
							| 
									
										
										
										
											2023-01-13 06:42:56 -08:00
										 |  |  |     // Output dir is shared with vite.sw.config.ts, clearing it here is racy.
 | 
					
						
							|  |  |  |     emptyOutDir: false, | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |     rollupOptions: { | 
					
						
							| 
									
										
										
										
											2023-01-30 19:07:52 -08:00
										 |  |  |       input: { | 
					
						
							|  |  |  |         index: path.resolve(__dirname, 'index.html'), | 
					
						
							| 
									
										
										
										
											2023-04-19 18:16:18 -07:00
										 |  |  |         uiMode: path.resolve(__dirname, 'uiMode.html'), | 
					
						
							| 
									
										
										
										
											2024-06-28 18:36:11 +01:00
										 |  |  |         embedded: path.resolve(__dirname, 'embedded.html'), | 
					
						
							| 
									
										
										
										
											2023-06-21 21:10:50 +02:00
										 |  |  |         snapshot: path.resolve(__dirname, 'snapshot.html'), | 
					
						
							| 
									
										
										
										
											2023-01-30 19:07:52 -08:00
										 |  |  |       }, | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |       output: { | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |         entryFileNames: () => '[name].[hash].js', | 
					
						
							| 
									
										
										
										
											2022-03-25 13:12:00 -08:00
										 |  |  |         assetFileNames: () => '[name].[hash][extname]', | 
					
						
							|  |  |  |         manualChunks: undefined, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | }); |