Conditionally upload domestic assets to Meteor

Is there a way to prevent all assets in my / client folder from automatically loading?

I am considering a scenario where my login page uses different css / js files than my registration or viewing user folders. What is the best way to do this?

Closest I came to the solution to this , but this still does not solve my problem.

Or is the best approach to host my files externally and then an external-file-loader user with conditional statements?

+4
source share
1 answer

modules -, .

mrt add modules

, .module_js .module_html ( css). ,

modules
  module1
    file1.module_js
    file2.module_js
  module2
    file1.module_js
    file2.module_js
client
  main.js
server
public
...

main.js . , require:

require('module1', function () {
  console.log('the files contained in module1 folder are now loaded');
});
0

Source: https://habr.com/ru/post/1534267/


All Articles