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.
|
|
|
|
*/
|
|
|
|
|
2025-03-06 09:15:37 +01:00
|
|
|
import path from 'path';
|
|
|
|
|
2022-03-25 13:12:00 -08:00
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import react from '@vitejs/plugin-react';
|
2025-03-06 09:15:37 +01:00
|
|
|
|
2022-06-16 15:18:25 -08:00
|
|
|
import { bundle } from './bundle';
|
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
|
|
|
],
|
2024-11-08 15:08:58 +01:00
|
|
|
define: {
|
|
|
|
'process.env': {},
|
|
|
|
},
|
2022-03-25 13:12:00 -08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2025-04-03 16:09:03 -07:00
|
|
|
'@injected': path.resolve(__dirname, '../injected/src'),
|
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'),
|
2024-11-13 13:08:50 +01:00
|
|
|
emptyOutDir: true,
|
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'),
|
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,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|