-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add requirement for main.ts
on the server in README.md
#12
Comments
Yes, I'll add it for sure. Though, presence of main.ts is not required like you said; if it's there it'll be imported if it's not you'll need to import another module manually. |
How do you import another module on the server to be executed at startup? |
Same way you'd do it for client side:
|
Hmm, maybe I got the wrong idea how stuff works, bu if you don't create a |
Maybe I slowly got it. js files are executed normally without being registered as system.js modules, so Meteor.startup(function(){
System.import('server/foo').await();
}) right!? |
@sclausen yes, exactly. foo.ts |
Hmm, but the server doesn't know about system.js…
Do I have to manually add systemjs:systemjs to my project, or am I doing something still wrong? |
You seem to be missing something. If there wasn't System defined on the server, it wouldn't work even with |
systemjs:systemjs should be added to your app by the package. |
Okay, I don't know, what I did wrong before. Everything now works as expected. The custom import in a server-side js-file works like a charm. |
Use System in pure .js-files, in .ts ones you don't need it |
Yeah I know, I got that after writing my third comment in this issue, but I did something wrong and was confused about the server not knowing anything about the systemjs:systemjs in my js-file although added it in barbatus:angular2… Thanks for clarification! |
You can't choose another main-module than main.ts on the server, because it is hardcoded in barbatus:angular2.
The text was updated successfully, but these errors were encountered: