From ce34a60387db1b783915fdeb298c0b9fdf18bce1 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 15 Jun 2018 16:10:26 -0400 Subject: [PATCH 1/6] Source maps and minification for dynamic CSS modules. (#9998) When a CSS (or compiled-to-CSS) module is lazy (e.g., in `imports/` or `node_modules`) and not otherwise imported by another CSS module, Meteor automatically turns it into a JS module so that it can be handled by the `ImportScanner`, and imported dynamically by other JS modules. Until now, there were two problems with CSS handled in this way: it did not have proper source maps, and the CSS text was not minified in production. This commit introduces a special minification step for dynamic CSS, which must take place before we create the dynamic JS module. Waiting for the usual minification of CSS would be a mistake, since that happens long after the `ImportScanner` and `Linker` have already processed JavaScript modules. Modifying the contents of JS modules at that point would be impossible without recomputing source maps, etc. Since the JS module dynamically creates a `