mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
feat: upgrade to Vite v5
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { basename, relative, resolve, extname } from 'node:path';
|
||||
import { basename, relative, resolve, extname, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { globSync } from 'glob';
|
||||
import { Project } from 'ts-morph';
|
||||
@ -7,6 +8,7 @@ const snakeToCamel = (text: string) =>
|
||||
text.replace(/-(\w)/g, (_, letter: string) => letter.toUpperCase());
|
||||
|
||||
export const i18nImporter = () => {
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const project = new Project({
|
||||
tsConfigFilePath: resolve(__dirname, '..', 'tsconfig.json'),
|
||||
skipAddingFilesFromTsConfig: true,
|
||||
@ -1,4 +1,5 @@
|
||||
import { basename, relative, resolve, extname } from 'node:path';
|
||||
import { basename, relative, resolve, extname, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { globSync } from 'glob';
|
||||
import { Project } from 'ts-morph';
|
||||
@ -9,6 +10,7 @@ const snakeToCamel = (text: string) =>
|
||||
export const pluginVirtualModuleGenerator = (
|
||||
mode: 'main' | 'preload' | 'renderer',
|
||||
) => {
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const project = new Project({
|
||||
tsConfigFilePath: resolve(__dirname, '..', 'tsconfig.json'),
|
||||
skipAddingFilesFromTsConfig: true,
|
||||
@ -1,5 +1,6 @@
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { resolve, basename } from 'node:path';
|
||||
import { resolve, basename, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { createFilter } from 'vite';
|
||||
import { Project, ts, ObjectLiteralExpression, VariableDeclarationKind } from 'ts-morph';
|
||||
@ -17,6 +18,8 @@ export default function (mode: 'backend' | 'preload' | 'renderer' | 'none'): Plu
|
||||
async load(id) {
|
||||
if (!pluginFilter(id)) return null;
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const project = new Project({
|
||||
tsConfigFilePath: resolve(__dirname, '..', 'tsconfig.json'),
|
||||
skipAddingFilesFromTsConfig: true,
|
||||
Reference in New Issue
Block a user