How do I minify CSS classnames with Ember CLI?









up vote
1
down vote

favorite
1












I looked through the docs on how to do this but nothing turned up.



There's this:




The compiled css-files are minified by broccoli-clean-css or
broccoli-csso, if it is installed locally




So I'm guessing it uses broccoli-clean-css by default which uses clean-css. I looked at both clean-css and csso and neither seem to have an option for mangling/minifying class names.



So I looked at how the React / Webpack folks are doing it. They seem to use css-loader which relies on post-css.



As far as I can tell, Ember doesn't use PostCSS out of the box?



Question: how can I get Ember CLI to mangle class names and remove useless classes/IDs like .ember-view and #ember123?



My motivation for this is I want to cache SSR content in Redis but my Redis instance is filling up so I need smaller payloads.



Edit:



I'm using ember-component-css but it doesn't have support for controlling all class names in a module.



Looks like I'd have to migrate to ember-css-modules which has the generateScopedName config option.










share|improve this question























  • I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
    – jelhan
    9 hours ago










  • @jelhan what's the reason?
    – Maros Hluska
    9 hours ago














up vote
1
down vote

favorite
1












I looked through the docs on how to do this but nothing turned up.



There's this:




The compiled css-files are minified by broccoli-clean-css or
broccoli-csso, if it is installed locally




So I'm guessing it uses broccoli-clean-css by default which uses clean-css. I looked at both clean-css and csso and neither seem to have an option for mangling/minifying class names.



So I looked at how the React / Webpack folks are doing it. They seem to use css-loader which relies on post-css.



As far as I can tell, Ember doesn't use PostCSS out of the box?



Question: how can I get Ember CLI to mangle class names and remove useless classes/IDs like .ember-view and #ember123?



My motivation for this is I want to cache SSR content in Redis but my Redis instance is filling up so I need smaller payloads.



Edit:



I'm using ember-component-css but it doesn't have support for controlling all class names in a module.



Looks like I'd have to migrate to ember-css-modules which has the generateScopedName config option.










share|improve this question























  • I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
    – jelhan
    9 hours ago










  • @jelhan what's the reason?
    – Maros Hluska
    9 hours ago












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I looked through the docs on how to do this but nothing turned up.



There's this:




The compiled css-files are minified by broccoli-clean-css or
broccoli-csso, if it is installed locally




So I'm guessing it uses broccoli-clean-css by default which uses clean-css. I looked at both clean-css and csso and neither seem to have an option for mangling/minifying class names.



So I looked at how the React / Webpack folks are doing it. They seem to use css-loader which relies on post-css.



As far as I can tell, Ember doesn't use PostCSS out of the box?



Question: how can I get Ember CLI to mangle class names and remove useless classes/IDs like .ember-view and #ember123?



My motivation for this is I want to cache SSR content in Redis but my Redis instance is filling up so I need smaller payloads.



Edit:



I'm using ember-component-css but it doesn't have support for controlling all class names in a module.



Looks like I'd have to migrate to ember-css-modules which has the generateScopedName config option.










share|improve this question















I looked through the docs on how to do this but nothing turned up.



There's this:




The compiled css-files are minified by broccoli-clean-css or
broccoli-csso, if it is installed locally




So I'm guessing it uses broccoli-clean-css by default which uses clean-css. I looked at both clean-css and csso and neither seem to have an option for mangling/minifying class names.



So I looked at how the React / Webpack folks are doing it. They seem to use css-loader which relies on post-css.



As far as I can tell, Ember doesn't use PostCSS out of the box?



Question: how can I get Ember CLI to mangle class names and remove useless classes/IDs like .ember-view and #ember123?



My motivation for this is I want to cache SSR content in Redis but my Redis instance is filling up so I need smaller payloads.



Edit:



I'm using ember-component-css but it doesn't have support for controlling all class names in a module.



Looks like I'd have to migrate to ember-css-modules which has the generateScopedName config option.







css ember.js ember-cli






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 13 hours ago

























asked 14 hours ago









Maros Hluska

1,02811536




1,02811536











  • I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
    – jelhan
    9 hours ago










  • @jelhan what's the reason?
    – Maros Hluska
    9 hours ago
















  • I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
    – jelhan
    9 hours ago










  • @jelhan what's the reason?
    – Maros Hluska
    9 hours ago















I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
– jelhan
9 hours ago




I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
– jelhan
9 hours ago












@jelhan what's the reason?
– Maros Hluska
9 hours ago




@jelhan what's the reason?
– Maros Hluska
9 hours ago

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53236615%2fhow-do-i-minify-css-classnames-with-ember-cli%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53236615%2fhow-do-i-minify-css-classnames-with-ember-cli%23new-answer', 'question_page');

);

Post as a guest














































































這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands