Meteor, how to serve multiple css for different types of media?

I would like my Meteor app to serve multiple css pages for different types of media. For instance:

<link rel="stylesheet" type="text/css" media="screen" href="screen.css" /> <link rel="stylesheet" type="text/css" media="print" href="print.css" /> <link rel="stylesheet" type="text/css" media="handheld" href="handheld.css" /> 

How can I do it?

+4
source share
1 answer
 /packages/meteor/package.js 

it is determined that .css files must be linked.

However, having carefully examined docs.meteor.com , we can find this information:

CSS files work the same way: the client will receive a package with all the CSS in your tree (excluding server and public subdirectories).

This last part is an interesting bit, if you put your CSS files in /public , they will not be combined together. Instead, app/lib/bundler.js runs the following line 517:

 files.cp_r(path.join(project_dir, 'public'), path.join(build_path, 'static'), {ignore: ignore_files}); 

And on the server side, any unresolved files will also be checked in build/static , which means that when you install screen.css in /public you can continue to use screen.css on the client.

+8
source

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


All Articles