| 
									
										
										
										
											2022-11-01 15:04:30 -07: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'; | 
					
						
							|  |  |  | import { bundle } from './bundle'; | 
					
						
							| 
									
										
										
										
											2024-07-10 22:32:08 +02:00
										 |  |  | import path from 'path'; | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | // https://vitejs.dev/config/
 | 
					
						
							|  |  |  | export default defineConfig({ | 
					
						
							|  |  |  |   base: '', | 
					
						
							|  |  |  |   plugins: [ | 
					
						
							|  |  |  |     react(), | 
					
						
							|  |  |  |     bundle() | 
					
						
							|  |  |  |   ], | 
					
						
							|  |  |  |   resolve: { | 
					
						
							|  |  |  |     alias: { | 
					
						
							| 
									
										
										
										
											2023-03-06 18:49:14 -08:00
										 |  |  |       '@isomorphic': path.resolve(__dirname, '../playwright-core/src/utils/isomorphic'), | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |       '@protocol': path.resolve(__dirname, '../protocol/src'), | 
					
						
							| 
									
										
										
										
											2023-03-14 15:58:55 -07:00
										 |  |  |       '@testIsomorphic': path.resolve(__dirname, '../playwright-core/src/utils/testIsomorphic'), | 
					
						
							| 
									
										
										
										
											2023-02-22 21:08:47 -08:00
										 |  |  |       '@trace': path.resolve(__dirname, '../trace/src'), | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |       '@web': path.resolve(__dirname, '../web/src'), | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2024-11-08 15:08:58 +01:00
										 |  |  |   publicDir: false, | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |   build: { | 
					
						
							| 
									
										
										
										
											2024-11-08 15:08:58 +01:00
										 |  |  |     // outputs into the public dir, where the build of vite.config.ts will pick it up
 | 
					
						
							|  |  |  |     outDir: path.resolve(__dirname, 'public'), | 
					
						
							| 
									
										
										
										
											2023-01-13 06:42:56 -08:00
										 |  |  |     emptyOutDir: false, | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |     rollupOptions: { | 
					
						
							|  |  |  |       input: { | 
					
						
							| 
									
										
										
										
											2024-09-26 11:22:20 -07:00
										 |  |  |         sw: path.resolve(__dirname, 'src/sw-main.ts'), | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |       }, | 
					
						
							|  |  |  |       output: { | 
					
						
							| 
									
										
										
										
											2024-09-26 11:22:20 -07:00
										 |  |  |         entryFileNames: info => 'sw.bundle.js', | 
					
						
							|  |  |  |         assetFileNames: () => 'sw.[hash][extname]', | 
					
						
							| 
									
										
										
										
											2022-11-01 15:04:30 -07:00
										 |  |  |         manualChunks: undefined, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | }); |