mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: optimize service worker cache load
This commit is contained in:
8 files changed
+34
-23
No files matched your search
@@ -30,7 +30,8 @@ const federationPlugin: esbuild.Plugin = {
|
||||
setup(b) {
|
||||
const packages = {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
'react/jsx-runtime': 'jsxRuntime',
|
||||
'react-dom/client': 'ReactDOM',
|
||||
jquery: '$',
|
||||
};
|
||||
b.onResolve({ filter: /^@hydrooj\/ui-default/ }, () => ({
|
||||
@@ -38,7 +39,7 @@ const federationPlugin: esbuild.Plugin = {
|
||||
namespace: 'ui-default',
|
||||
}));
|
||||
for (const key in packages) {
|
||||
b.onResolve({ filter: new RegExp(`^${key}($|\\/)`) }, () => ({
|
||||
b.onResolve({ filter: new RegExp(`^${key}$`) }, () => ({
|
||||
path: packages[key],
|
||||
namespace: 'ui-default',
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user