gpt4 book ai didi

ember.js - ember assets - "public" Assets 不应该被指纹识别但它们是?

转载 作者:行者123 更新时间:2023-12-02 14:49:53 25 4
gpt4 key购买 nike

在我的 Ember.js 3.8 项目中,我有一个图像文件:

/public/assets/images/foo.png

... 根据this (admittedly a little out of date)放在 public/assets/images 中的文件在被引用为 assets/images 时应该保持不变。

This是最新的,不太明确,但表示放置在 public 下的项目最终将在 assets 下。

当我进行生产构建时,我在 /public/assets/images/ 中的文件以 /dist/assets/images/ 结束,但带有指纹,例如 foo-97cf8c0765aefa517d22e1fc71f43d6e.png

我是要明确禁止指纹识别吗? doco 似乎暗示没有必要?

最佳答案

看看这些 ember-cli docs ,具体来说:

When the environment is production (e.g. ember build --environment=production), the addon will automatically fingerprint your js, css, png, jpg, and gif assets by appending an md5 checksum to the end of their filename (e.g. assets/yourapp-9c2cbd818d09a4a742406c6cb8219b3b.js). In addition, your html, js, and css files will be re-written to include the new name. There are a few options you can pass in to EmberApp in your ember-cli-build.js to customize this behavior.

从指纹识别的角度来看,对图像进行指纹识别是有意义的,因为您可能需要更改它们并且不想等到缓存 TTL 过期。

您可以删除特定文件

fingerprint: {
exclude: ['assets/images/user.png']
}

或整个文件扩展名

fingerprint:{
extensions: ['js', 'css', /* all the extensions you do want excluding image ones */]
}

关于ember.js - ember assets - "public" Assets 不应该被指纹识别但它们是?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56320569/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com