2022-03-25 22:12:00 +01: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-17 01:18:25 +02:00
|
|
|
import { bundle } from './bundle';
|
2025-02-07 23:44:00 +01:00
|
|
|
import * as path from 'path';
|
2022-03-25 22:12:00 +01:00
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
2022-04-05 06:53:19 +02:00
|
|
|
base: '',
|
2022-03-25 22:12:00 +01:00
|
|
|
plugins: [
|
2022-06-17 01:18:25 +02:00
|
|
|
react(),
|
|
|
|
|
bundle()
|
2022-03-25 22:12:00 +01:00
|
|
|
],
|
2024-11-08 15:08:58 +01:00
|
|
|
define: {
|
|
|
|
|
'process.env': {},
|
|
|
|
|
},
|
2022-03-25 22:12:00 +01:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
2023-02-17 20:19:53 +01:00
|
|
|
'@injected': path.resolve(__dirname, '../playwright-core/src/server/injected'),
|
2023-03-07 03:49:14 +01:00
|
|
|
'@isomorphic': path.resolve(__dirname, '../playwright-core/src/utils/isomorphic'),
|
2022-09-21 03:41:51 +02:00
|
|
|
'@protocol': path.resolve(__dirname, '../protocol/src'),
|
2023-09-08 23:23:35 +02:00
|
|
|
'@testIsomorphic': path.resolve(__dirname, '../playwright/src/isomorphic'),
|
2023-03-02 00:27:23 +01:00
|
|
|
'@trace': path.resolve(__dirname, '../trace/src'),
|
2022-03-25 22:12:00 +01:00
|
|
|
'@web': path.resolve(__dirname, '../web/src'),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
build: {
|
2023-08-20 01:16:44 +02:00
|
|
|
outDir: path.resolve(__dirname, '../playwright-core/lib/vite/traceViewer'),
|
2024-11-13 13:08:50 +01:00
|
|
|
emptyOutDir: true,
|
2022-03-25 22:12:00 +01:00
|
|
|
rollupOptions: {
|
2023-01-31 04:07:52 +01:00
|
|
|
input: {
|
|
|
|
|
index: path.resolve(__dirname, 'index.html'),
|
2023-04-20 03:16:18 +02:00
|
|
|
uiMode: path.resolve(__dirname, 'uiMode.html'),
|
2023-06-21 21:10:50 +02:00
|
|
|
snapshot: path.resolve(__dirname, 'snapshot.html'),
|
2023-01-31 04:07:52 +01:00
|
|
|
},
|
2022-03-25 22:12:00 +01:00
|
|
|
output: {
|
2022-11-01 23:04:30 +01:00
|
|
|
entryFileNames: () => '[name].[hash].js',
|
2022-03-25 22:12:00 +01:00
|
|
|
assetFileNames: () => '[name].[hash][extname]',
|
|
|
|
|
manualChunks: undefined,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
});
|