2015-07-12 51 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

因此,我得到了它的工作,但我仍然很想知道發生了什麼。畢竟這是我最初的問題。如果有人知道這裏發生了什麼,請告訴我。

我手動刪除了應用程序並重新安裝了它。這對我有效。我的猜測是由於某種原因緩存了舊版本的文件。

相關問題