forked from miao-moe/QZMusic_PC
fork(fix): Clone AMLL 并修复 BUG
- 将AMLL Clone到本以地进行修复和优化(emm虽然这很不优雅但是暂时无时间做子模块和Fork) - 修复在当前播放歌词行不可见的视口Seek会出现滚动偏移的问题
This commit is contained in:
34
amll-local/packages/core/tsdown.config.ts
Normal file
34
amll-local/packages/core/tsdown.config.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { defineConfig } from "tsdown";
|
||||
import { baseConfig } from "../../tsdown.base.ts";
|
||||
|
||||
const rawQueryPlugin = {
|
||||
name: "raw-query",
|
||||
resolveId(id: string, importer: string | undefined) {
|
||||
if (id.endsWith("?raw")) {
|
||||
const rawPath = id.slice(0, -4);
|
||||
const base = importer ? `file://${importer}` : `file://${process.cwd()}/`;
|
||||
const resolved = new URL(rawPath, base).pathname.replace(
|
||||
/^\/([A-Za-z]:)/,
|
||||
"$1",
|
||||
);
|
||||
return `\0raw:${resolved}`;
|
||||
}
|
||||
},
|
||||
load(id: string) {
|
||||
if (id.startsWith("\0raw:")) {
|
||||
const file = id.slice(5);
|
||||
const content = readFileSync(file, "utf-8");
|
||||
return `export default ${JSON.stringify(content)}`;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
...baseConfig,
|
||||
entry: { "amll-core": "./src/index.ts" },
|
||||
plugins: [rawQueryPlugin],
|
||||
define: {
|
||||
"import.meta.env.DEV": "process.env.NODE_ENV !== 'production'",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user