gpt4 book ai didi

performance - 为什么是 storeConfigInMeta : false not the default in Ember CLI?

转载 作者:行者123 更新时间:2023-12-04 18:33:00 24 4
gpt4 key购买 nike

来自 http://ember-cli.com/user-guide/ :

Application configurations from your ember-cli-build.js file will be stored inside a special meta tag in dist/index.html.

sample meta tag:

<meta name="user/config/environment" content="%7B%22modulePre.your.config">

This meta tag is required for your ember application to function properly. If you prefer to have this tag be part of your compiled javascript files instead, you may use the storeConfigInMeta flag in ember-cli-build.js.

// ember-cli-build.js
var app = new EmberApp({
storeConfigInMeta: false
});


在生产中,这个元标签看起来像
<meta name="app/config/environment" content="%7B%22modulePrefix%22%3A%app%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22...

并且很长。将配置对象作为 Javascript Assets 的一部分,而不是要求应用程序在启动后解析所有文本,不是更高效吗?

最佳答案

通过将其置于 JS 负载外部,可以更改元标记以配置 JS 应用程序,而无需重新编译应用程序。它在某些情况下非常有用......

关于performance - 为什么是 storeConfigInMeta : false not the default in Ember CLI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37323756/

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