1
0

restore support for local dev using a non-local url

This commit is contained in:
Hazelnoot
2025-02-06 12:57:44 -05:00
parent eaed8f2cec
commit 0d1c993dd2
3 changed files with 2 additions and 17 deletions
-6
View File
@@ -3,8 +3,6 @@ import pluginReplace from '@rollup/plugin-replace';
import pluginVue from '@vitejs/plugin-vue';
import { type UserConfig, defineConfig } from 'vite';
import { localesVersion } from '../../locales/version.js';
import * as yaml from 'js-yaml';
import { promises as fsp } from 'fs';
import locales from '../../locales/index.js';
import meta from '../../package.json';
@@ -13,9 +11,6 @@ import pluginUnwindCssModuleClassName from './lib/rollup-plugin-unwind-css-modul
import pluginJson5 from './vite.json5.js';
import { pluginReplaceIcons } from './vite.replaceIcons.js';
const url = process.env.NODE_ENV === 'development' ? yaml.load(await fsp.readFile('../../.config/default.yml', 'utf-8')).url : null;
const host = url ? (new URL(url)).hostname : undefined;
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue', '.wasm'];
/**
@@ -82,7 +77,6 @@ export function getConfig(): UserConfig {
base: '/vite/',
server: {
host,
port: 5173,
hmr: {
// バックエンド経由での起動時、Viteは5173経由でアセットを参照していると思い込んでいるが実際は3000から配信される