2023-07-31 12:13:49 +00:00
|
|
|
import react from '@vitejs/plugin-react';
|
2023-09-05 12:06:55 +00:00
|
|
|
import { visualizer } from 'rollup-plugin-visualizer';
|
2023-08-16 15:48:04 +00:00
|
|
|
import { defineConfig } from 'vite';
|
2023-07-31 12:13:49 +00:00
|
|
|
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
|
|
import svgr from 'vite-plugin-svgr';
|
2023-08-16 15:48:04 +00:00
|
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
2023-07-31 12:13:49 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
base: './',
|
|
|
|
build: {
|
|
|
|
outDir: 'dist/v1',
|
|
|
|
rollupOptions: {
|
|
|
|
input: {
|
2023-08-16 15:48:04 +00:00
|
|
|
app: './checkout.html',
|
|
|
|
},
|
|
|
|
},
|
2023-07-31 12:13:49 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
svgr(),
|
|
|
|
tsconfigPaths(),
|
|
|
|
viteStaticCopy({
|
|
|
|
targets: [
|
|
|
|
{
|
|
|
|
src: 'src/appConfig.json',
|
2023-08-16 15:48:04 +00:00
|
|
|
dest: './',
|
2023-07-31 12:13:49 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'src/env.json',
|
2023-08-16 15:48:04 +00:00
|
|
|
dest: './',
|
2023-07-31 12:13:49 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'src/assets/*',
|
2023-08-16 15:48:04 +00:00
|
|
|
dest: './assets',
|
2023-07-31 12:13:49 +00:00
|
|
|
},
|
2023-08-16 15:48:04 +00:00
|
|
|
],
|
|
|
|
}),
|
2023-09-05 12:06:55 +00:00
|
|
|
visualizer(),
|
2023-07-31 12:13:49 +00:00
|
|
|
],
|
|
|
|
server: {
|
|
|
|
port: 7050,
|
|
|
|
proxy: {
|
|
|
|
'^/v1': {
|
|
|
|
target: 'http://localhost:7050',
|
2023-08-16 15:48:04 +00:00
|
|
|
rewrite: (path) => path.replace(/^\/v1/, ''),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-07-31 12:13:49 +00:00
|
|
|
});
|