You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
3 years ago
|
import { resolve } from "path";
|
||
|
|
||
|
import reactRefresh from "@vitejs/plugin-react-refresh";
|
||
|
import { defineConfig } from "vite";
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig({
|
||
|
plugins: [
|
||
|
(
|
||
|
process.env.NODE_ENV !== "test"
|
||
|
? [reactRefresh()]
|
||
|
: []
|
||
|
),
|
||
|
],
|
||
|
build: {
|
||
|
rollupOptions: {
|
||
|
input: {
|
||
|
maker: resolve(__dirname, "maker.html"),
|
||
|
taker: resolve(__dirname, "taker.html"),
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
server: {
|
||
|
open: "/maker",
|
||
|
},
|
||
|
// server: {
|
||
|
// proxy: {
|
||
|
// '/foo': 'http://localhost:4567',
|
||
|
// '/api': {
|
||
|
// target: 'http://jsonplaceholder.typicode.com',
|
||
|
// changeOrigin: true,
|
||
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||
|
// },
|
||
|
// // with RegEx
|
||
|
// '^/fallback/.*': {
|
||
|
// target: 'http://jsonplaceholder.typicode.com',
|
||
|
// changeOrigin: true,
|
||
|
// rewrite: (path) => path.replace(/^\/fallback/, '')
|
||
|
// },
|
||
|
// // Using the proxy instance
|
||
|
// '/api': {
|
||
|
// target: 'http://jsonplaceholder.typicode.com',
|
||
|
// changeOrigin: true,
|
||
|
// configure: (proxy, options) => {
|
||
|
// // proxy will be an instance of 'http-proxy'
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
});
|