sencha-touch-2 - sencha 应用程序构建生产无法正常工作

标签 sencha-touch-2

我使用 sencha create app 命令创建了我的应用程序。它可以在我的机器上本地运行,也可以在我们的网络服务器上运行。我正在尝试构建用于生产的应用程序,但以下命令对我不起作用:

sencha app build production

我没有收到任何错误消息或输出。目录中没有任何变化。

以下命令:

sencha build -p appname.jsb3 -v -d .

生成 jsb3 文件。但是,我的 index.html 从未更新以加载新文件。根据我在网上找到的信息,我的index.html应该更新为指向新文件。

我认为我在某个地方遗漏了一些东西,但我找不到任何适合我的在线教程。有人能指出我正确的方向吗?我的index.html 粘贴在下面,如果这有助于确定我做错了什么。

<!DOCTYPE HTML>
<html manifest="" lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>EGL Mobile</title>
    <style type="text/css">
        /**
         * Example of an initial loading indicator.
         * It is recommended to keep this as minimal as possible to provide instant feedback
         * while other resources are still being loaded for the first time
         */
        html, body {
            height: 100%;
        }

        #appLoadingIndicator {
            position: absolute;
            top: 50%;
            left: 50%;
            margin-top: -10px;
            margin-left: -50px;
            width: 100px;
            height: 20px;
        }

        #appLoadingIndicator > * {
            background-color: #FFFFFF;
            float: left;
            height: 20px;
            margin-left: 11px;
            width: 20px;
            -webkit-animation-name: appLoadingIndicator;
            -webkit-border-radius: 13px;
            -webkit-animation-duration: 0.8s;
            -webkit-animation-iteration-count: infinite;
            -webkit-animation-direction: linear;
            opacity: 0.3
        }

        #appLoadingIndicator > :nth-child(1) {
            -webkit-animation-delay: 0.18s;
        }

        #appLoadingIndicator > :nth-child(2) {
            -webkit-animation-delay: 0.42s;
        }

        #appLoadingIndicator > :nth-child(3) {
            -webkit-animation-delay: 0.54s;
        }

        @-webkit-keyframes appLoadingIndicator{
            0% {
                opacity: 0.3
            }

            50% {
                opacity: 1;
                background-color:#1985D0
            }

            100% {
                opacity:0.3
            }
        }
    </style>
    <script id="microloader" type="text/javascript" src="sdk/microloader/development.js"></script>
</head>
<body>
    <div id="appLoadingIndicator">
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>
</html>

最佳答案

试试这个:

//首先打开cmd并运行:

cd path/to/application

//然后确保index.html存在于您的path/to/application中:

<!DOCTYPE html>
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>title</title>
 <!-- update this to your css file -->
 <link rel="stylesheet" href="resources/css/app.css" type="text/css">
 <!-- you can get this file from sencha original files -->
 <script type="text/javascript" src="sdk/sencha-touch-debug.js"></script>
 <script type="text/javascript" src="app.js"></script> 
</head>
<body></body>
</html>

//确保文件正在加载您的应用程序,然后运行命令:

sencha create jsb -a index.html -p app.jsb3

//同时执行第二条命令。请注意末尾的点应添加到命令中:

sencha build -p app.jsb3 -d .

//现在我们的应用程序已构建:

创建新的 html 文件“built.html”并使用以下代码:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>title</title>
    <link rel="stylesheet" href="resources/css/app.css" type="text/css">
    <script type="text/javascript" src="sdk/sencha-touch.js"></script>
    <script type="text/javascript" src="all-classes.js"></script>
    <script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>

//现在打开built.html

关于sencha-touch-2 - sencha 应用程序构建生产无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10588125/

相关文章:

sencha-touch-2 - 为什么 Sencha 2 只能在 Webkit 浏览器中运行?

javascript - Sencha Touch 模型中的字段转换功能失败

android - sencha touch 2 无法在我的安卓手机上启动

javascript - Sencha 触摸2 : Creating a Nested List inside a tab panel

javascript - 在 html5 移动应用程序中使用 JavaScript 倒数计时器

cordova - 在 android WebView 中禁用电子邮件、号码检测

ajax - Sencha Touch 2 中未保存 Cookie

ios - 我可以在没有 MAC 的情况下为 iOS 开发 Sencha Touch 应用程序吗?

javascript - Sencha touch 中的 onkeydown