mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-29 01:53:47 +08:00
cb0791cb41
* perf: use only one WASM alloc for xxhash * perf(deps): lazy load mercury-parser and use googleapis/youtube instead of heavy googleapis * perf(dx): lazy load dev registry speed up npm dev script * perf: close playwright browser on destroy * fix: show exception msg in prod * revert: "perf: use only one WASM alloc for xxhash" This reverts commit01ecdd48d0. * perf: use only one WASM alloc for xxhash * test: add claim for worker * fix: missing piece from8dd9c9a* feat: add namespace to the chunkfilename * fix: keep var naming
27 lines
856 B
TypeScript
27 lines
856 B
TypeScript
import { defineConfig } from 'tsdown';
|
|
|
|
const namespaceOf = (id: string) => id.match(/[\\/]lib[\\/]routes[\\/]([^\\/]+)[\\/]/)?.[1];
|
|
|
|
export default defineConfig({
|
|
entry: ['./lib/index.ts'],
|
|
minify: true,
|
|
shims: true,
|
|
clean: true,
|
|
copy: ['lib/assets'],
|
|
deps: {
|
|
onlyBundle: false,
|
|
},
|
|
outputOptions: {
|
|
chunkFileNames(chunk) {
|
|
let namespace = chunk.facadeModuleId ? namespaceOf(chunk.facadeModuleId) : undefined;
|
|
if (!namespace) {
|
|
const namespaces = new Set(chunk.moduleIds.map((id) => namespaceOf(id)));
|
|
if (namespaces.size === 1) {
|
|
namespace = [...namespaces][0];
|
|
}
|
|
}
|
|
return namespace && namespace !== chunk.name ? `${namespace}-[name]-[hash].mjs` : '[name]-[hash].mjs';
|
|
},
|
|
},
|
|
});
|