2023-12-07 15:22:08 -08:00
|
|
|
import dns from 'dns';
|
|
|
|
import { defineConfig } from 'vite';
|
2023-12-23 23:16:58 -08:00
|
|
|
import locales from '../../locales/index.js';
|
2023-12-07 15:22:08 -08:00
|
|
|
import { getConfig } from './vite.config.js';
|
|
|
|
|
|
|
|
dns.setDefaultResultOrder('ipv4first');
|
|
|
|
|
|
|
|
const defaultConfig = getConfig();
|
|
|
|
|
|
|
|
const devConfig = {
|
|
|
|
// 基本の設定は vite.config.js から引き継ぐ
|
|
|
|
...defaultConfig,
|
|
|
|
root: 'src',
|
|
|
|
publicDir: '../assets',
|
|
|
|
base: './',
|
|
|
|
server: {
|
|
|
|
host: 'localhost',
|
|
|
|
port: 5173,
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
|
|
|
changeOrigin: true,
|
|
|
|
target: 'http://localhost:3000/',
|
|
|
|
},
|
|
|
|
'/assets': 'http://localhost:3000/',
|
2023-12-07 23:32:24 -08:00
|
|
|
'/static-assets': 'http://localhost:3000/',
|
|
|
|
'/client-assets': 'http://localhost:3000/',
|
2023-12-07 15:22:08 -08:00
|
|
|
'/files': 'http://localhost:3000/',
|
|
|
|
'/twemoji': 'http://localhost:3000/',
|
|
|
|
'/fluent-emoji': 'http://localhost:3000/',
|
2024-01-04 11:42:25 -08:00
|
|
|
'/tossface': 'http://localhost:3000/',
|
2023-12-07 15:22:08 -08:00
|
|
|
'/sw.js': 'http://localhost:3000/',
|
|
|
|
'/streaming': {
|
|
|
|
target: 'ws://localhost:3000/',
|
|
|
|
ws: true,
|
|
|
|
},
|
|
|
|
'/favicon.ico': 'http://localhost:3000/',
|
|
|
|
'/identicon': {
|
|
|
|
target: 'http://localhost:3000/',
|
|
|
|
rewrite(path) {
|
|
|
|
return path.replace('@localhost:5173', '');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/url': 'http://localhost:3000',
|
|
|
|
'/proxy': 'http://localhost:3000',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
...defaultConfig.build,
|
|
|
|
rollupOptions: {
|
|
|
|
...defaultConfig.build?.rollupOptions,
|
|
|
|
input: 'index.html',
|
|
|
|
},
|
|
|
|
},
|
2023-12-14 03:16:02 -08:00
|
|
|
|
|
|
|
define: {
|
|
|
|
...defaultConfig.define,
|
|
|
|
_LANGS_FULL_: JSON.stringify(Object.entries(locales)),
|
|
|
|
},
|
2023-12-07 15:22:08 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default defineConfig(({ command, mode }) => devConfig);
|
|
|
|
|