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
@@ -2,8 +2,6 @@ import path from 'path';
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';
@@ -11,9 +9,6 @@ import packageInfo from './package.json' with { type: 'json' };
import pluginJson5 from './vite.json5.js';
import { pluginReplaceIcons } from '../frontend/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'];
/**
@@ -69,7 +64,6 @@ export function getConfig(): UserConfig {
base: '/embed_vite/',
server: {
host,
port: 5174,
hmr: {
// バックエンド経由での起動時、Viteは5174経由でアセットを参照していると思い込んでいるが実際は3000から配信される