mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
Delete library-model.js (Backbone Models/Collections, no longer imported) and ui-select.js (dead code, was never imported). Remove the global window.Backbone exposure from libs.js, the backbone entry from Vite optimizeDeps, and the Backbone.Model usage in the trackster test mock.
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import { extensions, getViteAliases } from "./build-config.shared.js";
|
|
|
|
/**
|
|
* Vite plugin for Galaxy's legacy module resolution
|
|
*/
|
|
export function galaxyLegacyPlugin() {
|
|
return {
|
|
name: "vite-plugin-galaxy-legacy",
|
|
|
|
config: () => {
|
|
const aliases = getViteAliases();
|
|
|
|
return {
|
|
resolve: {
|
|
alias: aliases,
|
|
extensions,
|
|
},
|
|
|
|
optimizeDeps: {
|
|
// Pre-bundle problematic CommonJS dependencies
|
|
include: ["store", "jquery-migrate"],
|
|
|
|
// Fix CommonJS global references
|
|
esbuildOptions: {
|
|
define: {
|
|
global: "globalThis",
|
|
},
|
|
},
|
|
},
|
|
};
|
|
},
|
|
|
|
// Custom resolver for edge cases
|
|
resolveId(id) {
|
|
// Special handling for popper.js
|
|
if (id === "popper.js") {
|
|
return { id: "popper.js/dist/esm/popper.js", external: false };
|
|
}
|
|
|
|
return null;
|
|
},
|
|
};
|
|
}
|