I’m not satisfied with Meteor’s special directories and file load order rules.
For example, I would like to have this file structure:
myapp/
.meteor/
app/
base/
base.css
base.html
comments/
img/
new-comment.png
submit.png
comments.server.js
comments.client.js
comments.js
comments.html
comments.css
payments/
payments.server.js
payments.js
...
And, as a result, to achieve this:
-
base.css
should be loaded before other css files -
*.server.js
/*.client.js
files should be loaded to server/client only -
*.js
files should be loaded to both: client and server -
*.js
files should be loaded after*.server.js
and*.client.js
files - media assets (images, icons, etc) should be available by url
/assets/{moduleName}/{assetName}
(e.g./assets/comments/new-comment.png
)
But Meteor forces me to write:
myapp/
.meteor/
app/
base/
lib/
base.css
base.html
comments/
client/
comments.client.js
server/
comments.server.js
lib/
comments.js
comments.html
comments.css
payments/
server/
payments.server.js
lib/
payments.js
public/
assets/
comments/
new-comment.png
submit.png
Which kills all the beauty.
So I was thinking, is it possible to change Meteor’s behaviour? And the answer is Yes (with some limits).
Now I’m working on package called imkost:project-builder
which will allow to create your own build rules for Meteor applications.
It’s about to be finished soon. I already tried project-builder
in my project and… it sounds sort of selfish, I really love it!
What do you guys think of this? Is it a common issue or it’s just me who suffers from Meteor’s build rules?