Files
galaxy/client/vite-plugin-galaxy-legacy.js
T
Dannon Baker 9175233168 Remove backbone package and remaining infrastructure
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.
2026-04-01 09:39:26 -04:00

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;
},
};
}