ExtJS 6 app.js在新的生产版本之后不更新 [英] ExtJS 6 app.js does not updates after new production release

查看:513
本文介绍了ExtJS 6 app.js在新的生产版本之后不更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Extjs 6,我们正在使用 sencha cmd 来构建我们的应用程序。

We are using Extjs 6 and we are using sencha cmd to build our application.

我们正在面对一个问题每次我们发布我们的应用程序的生产版本,如6.3到6.4,捆绑的 app.js 不会更新,浏览器从(从磁盘高速缓冲存储器)。所以每次我们都要告诉我们的用户,请在新版本之后清除浏览器的缓存。 这是令人讨厌的

We are facing one issue. Every time we release production version of our application like 6.3 to 6.4, bundled app.js does not get updated and browser take that file from (from disk cache). So every time we have to tell our users that please clear your browser's cache after you got new release. That's annoying.

这是我的app.json文件。

This is my app.json file.

"output": {
        "base": "${workspace.build.dir}/${build.environment}/${app.name}",
        "page": "index.html",
        "manifest": "${build.id}.json",
        "js": "${build.id}/.js",
        "appCache": {
            "enable": false,
            "update": "full"
        },
        "resources": {
            "path": "${build.id}/resources",
            "shared": "resources"
        }
    },
"production": {
        "output": {
            "appCache": {
                "enable": false,
                "path": "cache.appcache"
            }
        },
......
"cache": {
            "enable": false 
        }
...


推荐答案

我找到解决方案:

"js": [
        {
            "path": "app.js",
            "bundle": true,
            "includeInBundle": false
        }
    ],
.....
"output": {
        "base": "${workspace.build.dir}/${build.environment}/${app.name}",
        "page": "index.html",
        "manifest": "${build.id}.json",
        "js": "${build.id}/app_${app.version}.js",
        "appCache": {
            "enable": false,
            "update": "full"
        },
        "resources": {
            "path": "${build.id}/resources",
            "shared": "resources"
        }
    },
....

这不会在生产构建和创建中包含 app.js 新的 app.js 文件,最后附加版本,如: app_6.4.js

This will not include app.js file in production build and create new app.js file with version appended at last to it like: app_6.4.js.

这篇关于ExtJS 6 app.js在新的生产版本之后不更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆