除 main.js 外,没有任何文件急切地加载到流星应用程序中
No files eagerly loaded in meteor application other than main.js
使用最新的 meteor 1.8 客户端创建了一个简单的 meteor 应用程序后:
meteor create testapp
然后在路径 server/test.js
下添加一个文件,我希望文件 main.js
和 test.js
被热切地加载到服务器端。然而只有 main.js
被加载到服务器端。
在 meteor documentation about file structure 中,据报道 main.js
是主要入口点,但如果存在的话,它并不是唯一急切导入的文件。
此行为的原因是 package.js
中的一个部分,该部分由 meteor create
创建
{
...,
"meteor": {
"mainModule": {
"client": "client/main.js",
"server": "server/main.js"
},
"testModule": "tests/main.js"
}
}
在 changelog to 1.8 他们提到了这种行为。
When specified, these entry points override Meteor's default module loading semantics, rendering imports directories unnecessary. If mainModule is left unspecified for either client or server, the default rules will apply for that architecture, as before. To disable eager loading of modules on a given architecture, simply provide a mainModule value of false.
所以解决方案是从 package.json
.
中删除 mainModule
部分
使用最新的 meteor 1.8 客户端创建了一个简单的 meteor 应用程序后:
meteor create testapp
然后在路径 server/test.js
下添加一个文件,我希望文件 main.js
和 test.js
被热切地加载到服务器端。然而只有 main.js
被加载到服务器端。
在 meteor documentation about file structure 中,据报道 main.js
是主要入口点,但如果存在的话,它并不是唯一急切导入的文件。
此行为的原因是 package.js
中的一个部分,该部分由 meteor create
{
...,
"meteor": {
"mainModule": {
"client": "client/main.js",
"server": "server/main.js"
},
"testModule": "tests/main.js"
}
}
在 changelog to 1.8 他们提到了这种行为。
When specified, these entry points override Meteor's default module loading semantics, rendering imports directories unnecessary. If mainModule is left unspecified for either client or server, the default rules will apply for that architecture, as before. To disable eager loading of modules on a given architecture, simply provide a mainModule value of false.
所以解决方案是从 package.json
.
mainModule
部分