mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
feat: reimplement inject css, fix types
This commit is contained in:
@ -6,13 +6,13 @@ import { Project, ts, ObjectLiteralExpression } from 'ts-morph';
|
||||
|
||||
import type { PluginOption } from 'vite';
|
||||
|
||||
export default function (mode: 'backend' | 'preload' | 'renderer' | 'none') {
|
||||
export default function (mode: 'backend' | 'preload' | 'renderer' | 'none'): PluginOption {
|
||||
const pluginFilter = createFilter([
|
||||
'src/plugins/*/index.{js,ts}',
|
||||
'src/plugins/*',
|
||||
]);
|
||||
|
||||
return <PluginOption>{
|
||||
return {
|
||||
name: 'ytm-plugin-loader',
|
||||
async load(id) {
|
||||
if (!pluginFilter(id)) return null;
|
||||
@ -98,7 +98,6 @@ export default function (mode: 'backend' | 'preload' | 'renderer' | 'none') {
|
||||
|
||||
return {
|
||||
code: src.getText(),
|
||||
ast: src,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user