mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: 优化资源加载
This commit is contained in:
1 parent
bc74870a39
commit
167c70c2b1
24 files changed
+167
-188
No files matched your search
@@ -112,7 +112,7 @@ nunjucks.runtime.memberLookup = function memberLookup(obj, val) {
|
||||
};
|
||||
const env = new Nunjucks();
|
||||
env.addGlobal('static_url', (assetName) => {
|
||||
const cdnPrefix = global.Hydro.model.system.get('server.cdn');
|
||||
const cdnPrefix = process.env.DEV ? '/' : global.Hydro.model.system.get('server.cdn');
|
||||
if (global.Hydro.ui.manifest[assetName]) {
|
||||
return `${cdnPrefix}${global.Hydro.ui.manifest[assetName]}`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user