2015-07-12 46 views
0

当我构建我的Meteor应用程序时,它不会创建有效的js或css文件。这种情况发生在我做的时候meteor run iosmeteor build ~/builddir --server=http://app.myserver.com:80/流星应用程序构建奇怪的文件;没有js/css的资源

下面的代码片段按照相应的顺序包含实际的CSS,JS和HTML文件。该html甚至没有格式正确,这似乎超级怪异。我错过了一些完全明显的东西?

有趣的是,这些文件的名称似乎没有改变。我的意思是说,这个css文件总是被命名为68656e12cb5647ccd9e1ca30f039055f336a08d2.css,而js文件总是被命名为83f43fb0b048a87151b782ce0ae04a95ecbae2e7.js

我做了一个find . | grep js和一个find . | grep css试图找到这些文件,但我敢肯定,他们不存在。

这是我的包列表:

ground:db     0.3.9* Ground Meteor.Collections offline 
iron:router    1.0.9 Routing specifically designed for Meteor 
meteor-platform   1.2.2 Include a standard set of Meteor packages in your app 
momentjs:moment   2.10.3 Moment.js (official): parse, validate, manipulate, and display dates - official Meteor packaging 
mrt:fittext    1.2.0 FitText packaged for Meteor. 
pauloborges:mapbox  2.1.4_3 Mapbox.js for Meteor apps 
reactive-var    1.0.5 Reactive variable 
u2622:persistent-session 0.3.5 Persistently store Session data on the client 

<!DOCTYPE html > 
 
<html> 
 
<head> 
 
< meta charset = "utf-8" > 
 
< meta name = "format-detection" content = "telephone=no" > 
 
< meta name = "viewport" content = "user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" > 
 
< meta name = "msapplication-tap-highlight" content = "no" > 
 
< link rel = "stylesheet" type = "text/css" class = "__meteor-css__" href = "/68656e12cb5647ccd9e1ca30f039055f336a08d2.css?meteor_css_resource=true" > 
 
< script type = "text/javascript" > 
 
__meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.1.0.2%22%2C%22PUBLIC_SETTINGS%22%3A%7B%22othersetting%22%3A%22anothervalue%22%7D%2C%22ROOT_URL%22%3A%22http%3A%2F%2Fnbt.otterhive.com%2F%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22autoupdateVersion%22%3A%22bcf325756930a7028774c23bd28b4cc053de29ba%22%2C%22autoupdateVersionRefreshable%22%3A%22393b25460d4096237fe166edc70a833659c1d58b%22%2C%22autoupdateVersionCordova%22%3A%227c4f521c660011a4692d147b69dc64a13f578719%22%2C%22DDP_DEFAULT_CONNECTION_URL%22%3A%22http%3A%2F%2Fnbt.otterhive.com%2F%22%7D")); 
 

 
if (/Android/i.test(navigator.userAgent)) { 
 
    // When Android app is emulated, it cannot connect to localhost, 
 
    // instead it should connect to 10.0.2.2 
 
    // (unless we're using an http proxy; then it works!) 
 
    if (!__meteor_runtime_config__.httpProxyPort) { 
 
     __meteor_runtime_config__.ROOT_URL = (__meteor_runtime_config__.ROOT_URL || '').replace(/localhost/i, '10.0.2.2'); 
 
     __meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL = (__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL || '').replace(/localhost/i, '10.0.2.2'); 
 
    } 
 
} 
 
< /script> 
 
< script type = "text/javascript" src = "/cordova.js"></script> 
 
< script type = "text/javascript" src = "/83f43fb0b048a87151b782ce0ae04a95ecbae2e7.js"></script> 
 

 
< meta charset = "utf-8" > 
 
< meta http - equiv = "X-UA-Compatible" content = "IE=edge" > 
 
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" > 
 
<title> Nature Based Therapeutics < /title> 
 
< /head> 
 
<body> 
 

 
< /body> 
 
< /html>
< !DOCTYPE html> 
 
<html> 
 
<head> 
 
<meta charset="utf-8"> 
 
<meta name="format-detection" content="telephone=no"> 
 
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"> 
 
<meta name="msapplication-tap-highlight" content="no"> 
 
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/68656e12cb5647ccd9e1ca30f039055f336a08d2.css?meteor_css_resource=true"> 
 
<script type="text/javascript"> 
 
__meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.1.0.2%22%2C%22PUBLIC_SETTINGS%22%3A%7B%22othersetting%22%3A%22anothervalue%22%7D%2C%22ROOT_URL%22%3A%22http%3A%2F%2Fnbt.otterhive.com%2F%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22autoupdateVersion%22%3A%22bcf325756930a7028774c23bd28b4cc053de29ba%22%2C%22autoupdateVersionRefreshable%22%3A%22393b25460d4096237fe166edc70a833659c1d58b%22%2C%22autoupdateVersionCordova%22%3A%227c4f521c660011a4692d147b69dc64a13f578719%22%2C%22DDP_DEFAULT_CONNECTION_URL%22%3A%22http%3A%2F%2Fnbt.otterhive.com%2F%22%7D")); 
 

 
if (/Android/i.test(navigator.userAgent)) { 
 
    // When Android app is emulated, it cannot connect to localhost, 
 
    // instead it should connect to 10.0.2.2 
 
    // (unless we're using an http proxy; then it works!) 
 
    if (!__meteor_runtime_config__.httpProxyPort) { 
 
     __meteor_runtime_config__.ROOT_URL = (__meteor_runtime_config__.ROOT_URL || '').replace(/localhost/i, '10.0.2.2'); 
 
     __meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL = (__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL || '').replace(/localhost/i, '10.0.2.2'); 
 
    } 
 
} 
 

 
</script> 
 
<script type="text/javascript" src="/cordova.js"></script> 
 
<script type="text/javascript" src="/83f43fb0b048a87151b782ce0ae04a95ecbae2e7.js"></script> 
 

 
<meta charset="utf-8"> 
 
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
 
<title>Nature Based Therapeutics</title> 
 
</head> 
 
<body> 
 

 
</body> 
 
</html>
<!DOCTYPE html> 
 
<html> 
 
<head> 
 
    <meta charset="utf-8"> 
 
    <meta name="format-detection" content="telephone=no"> 
 
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"> 
 
    <meta name="msapplication-tap-highlight" content="no"> 
 

 
    <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/68656e12cb5647ccd9e1ca30f039055f336a08d2.css?meteor_css_resource=true"> 
 

 
    <script type="text/javascript"> 
 
    __meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.1.0.2%22%2C%22PUBLIC_SETTINGS%22%3A%7B%22othersetting%22%3A%22anothervalue%22%7D%2C%22ROOT_URL%22%3A%22http%3A%2F%2Fnbt.otterhive.com%2F%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22autoupdateVersion%22%3A%22bcf325756930a7028774c23bd28b4cc053de29ba%22%2C%22autoupdateVersionRefreshable%22%3A%22393b25460d4096237fe166edc70a833659c1d58b%22%2C%22autoupdateVersionCordova%22%3A%227c4f521c660011a4692d147b69dc64a13f578719%22%2C%22DDP_DEFAULT_CONNECTION_URL%22%3A%22http%3A%2F%2Fnbt.otterhive.com%2F%22%7D")); 
 

 
    if (/Android/i.test(navigator.userAgent)) { 
 
     // When Android app is emulated, it cannot connect to localhost, 
 
     // instead it should connect to 10.0.2.2 
 
     // (unless we're using an http proxy; then it works!) 
 
     if (!__meteor_runtime_config__.httpProxyPort) { 
 
     __meteor_runtime_config__.ROOT_URL = (__meteor_runtime_config__.ROOT_URL || '').replace(/localhost/i, '10.0.2.2'); 
 
     __meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL = (__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL || '').replace(/localhost/i, '10.0.2.2'); 
 
     } 
 
    } 
 
    </script> 
 

 
    <script type="text/javascript" src="/cordova.js"></script> 
 
    <script type="text/javascript" src="/83f43fb0b048a87151b782ce0ae04a95ecbae2e7.js"></script> 
 

 

 
    <meta charset="utf-8"> 
 
\t <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
 
\t <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
 
\t <title>Nature Based Therapeutics</title> 
 
</head> 
 

 
<body> 
 
    
 
</body> 
 
</html>

回答

0

当你使用它meteor build将创建一个包含节点应用柏油包。

css和js文件被缩小和连接。

如果你解压捆绑tar.gz文件,你会发现CSS,JS等静态文件bundle/programs/web.browser

记住的输出是一个应用程序不是一组旨在进行编辑的文件。

如果要编辑文件,请使用您的项目,而不是由meteor build创建的文件。

+0

我不想编辑文件。当我构建项目时,index.html文件有一个链接,指向我提到的js文件的css文件和脚本标记(这是缩小和串联的连接版本,我使用Safari的检查器检查了这些文件。并查看这些文件,这是index.html文件的奇怪破碎版本。此外,index.html中引用的文件绝对不存在于项目或构建结果中。 – soren468

0

因此,我得到了它的工作,但我仍然很想知道发生了什么。毕竟这是我最初的问题。如果有人知道这里发生了什么,请告诉我。

我手动删除了应用程序并重新安装了它。这对我有效。我的猜测是由于某种原因缓存了旧版本的文件。

相关问题