0

当我构建我的 Meteor 应用程序时,它没有创建有效的 js 或 css 文件。当我这样做meteor run iosmeteor build ~/builddir --server=http://app.myserver.com:80/

下面的代码片段分别包含实际的 CSS、JS 和 HTML 文件。html 甚至没有正确格式化,这对我来说似乎很奇怪。我错过了一些完全明显的东西吗?

需要注意的一个有趣的事情是文件的名称似乎没有改变。我的意思是css文件总是被命名68656e12cb5647ccd9e1ca30f039055f336a08d2.css,js文件总是被命名83f43fb0b048a87151b782ce0ae04a95ecbae2e7.js

我做了 afind . | grep js和 afind . | 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">
	<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>

4

2 回答 2

0

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

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

于 2015-07-12T21:52:35.330 回答
0

当您使用meteor build它时,它将创建一个包含节点应用程序的 tarred 包。

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

如果你解压捆绑的tar.gz文件,你会发现 css、js 和其他静态文件在bundle/programs/web.browser

请记住,输出是一个应用程序,而不是一组要编辑的文件。

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

于 2015-07-12T18:17:30.937 回答