Release 1.8 (formerly 1.7.1) #9942
Viewing a subset of changes. View all
Cache minified CSS in minifyCssFiles rather than relying on plugins.
Static CSS gets merged in development as well as production by ClientTarget#minifyCss; the only difference is that the CSS is also minified in production. This development-time merging is especially expensive because it involves source maps, and happens on every rebuild of the app. That's why ClientTarget#minifyCss consistently shows up in METEOR_PROFILE output for rebuilds. The standard-minifier-css package tries to cache the merging based on the hashes of the input files: https://github.com/meteor/meteor/blob/8a562523a44e33fd67278fb2e70798a2090df1ea/packages/standard-minifier-css/plugin/minify-css.js#L58-L62 However, not all CSS minifier plugins use a strategy like this, and https://atmospherejs.com/juliancwirko/postcss is an increasingly popular one that does not. The time has come to move this caching logic into the Meteor build tool itself, so that CSS minifier plugins no longer have to worry about basic caching, and everyone who uses CSS minifiers with Meteor will benefit. This implementation leverages Meteor's powerful optimistic caching techniques to keep previous results in memory only as long as the minifier object remains reachable.
- Loading branch information...
ProTip! Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews.