ui: frontend api (#470) [skip-cache]

This commit is contained in:
undefined authored and GitHub committed 2022-12-12 00:53:44 +08:00
1 parent 6d69e88739
commit 96fa6cc7b9
116 files changed
+599 -629

No files matched your search

+16 -1
View File
@@ -51,7 +51,22 @@ export async function buildUI() {
target: [
'chrome60',
],
plugins: global.Hydro.ui.esbuildPlugins || [],
plugins: [
...(global.Hydro.ui.esbuildPlugins || []),
{
name: 'federation',
setup(b) {
b.onResolve({ filter: /^@hydrooj\/ui-default/ }, () => ({
path: 'api',
namespace: 'ui-default',
}));
b.onLoad({ filter: /.*/, namespace: 'ui-default' }, () => ({
contents: 'module.exports = window.HydroExports;',
loader: 'tsx',
}));
},
},
],
minify: !process.env.DEV,
});
if (build.errors.length) console.error(build.errors);