How do I minify CSS classnames with Ember CLI?










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
    Nov 10 '18 at 11:34










  • @jelhan what's the reason?
    – Maros Hluska
    Nov 10 '18 at 11:58










  • Could you please add your use case? I'm not quite sure if I understand why you want to remove these IDs and class names.
    – jelhan
    Nov 12 '18 at 8:20










  • @jelhan the use case is given in the question: "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.". I do SSR with FastBoot. But an SSR request is slow (avg. 1 second) so I use Redis caching to speed it up. But I have lots of pages in Redis and I don't want to buy a larger Redis instance, thus I need smaller payloads in Redis. A couple techniques to achieve this: 1. mangle classes, 2. remove pointless classes
    – Maros Hluska
    Nov 13 '18 at 8:45










  • I don't think anyone has implemented this. Feel free to be the first.
    – Gaurav
    Nov 15 '18 at 18:47















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
    Nov 10 '18 at 11:34










  • @jelhan what's the reason?
    – Maros Hluska
    Nov 10 '18 at 11:58










  • Could you please add your use case? I'm not quite sure if I understand why you want to remove these IDs and class names.
    – jelhan
    Nov 12 '18 at 8:20










  • @jelhan the use case is given in the question: "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.". I do SSR with FastBoot. But an SSR request is slow (avg. 1 second) so I use Redis caching to speed it up. But I have lots of pages in Redis and I don't want to buy a larger Redis instance, thus I need smaller payloads in Redis. A couple techniques to achieve this: 1. mangle classes, 2. remove pointless classes
    – Maros Hluska
    Nov 13 '18 at 8:45










  • I don't think anyone has implemented this. Feel free to be the first.
    – Gaurav
    Nov 15 '18 at 18:47













1












1








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 Nov 10 '18 at 7:25

























asked Nov 10 '18 at 6:40









Maros Hluska

98811536




98811536











  • I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
    – jelhan
    Nov 10 '18 at 11:34










  • @jelhan what's the reason?
    – Maros Hluska
    Nov 10 '18 at 11:58










  • Could you please add your use case? I'm not quite sure if I understand why you want to remove these IDs and class names.
    – jelhan
    Nov 12 '18 at 8:20










  • @jelhan the use case is given in the question: "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.". I do SSR with FastBoot. But an SSR request is slow (avg. 1 second) so I use Redis caching to speed it up. But I have lots of pages in Redis and I don't want to buy a larger Redis instance, thus I need smaller payloads in Redis. A couple techniques to achieve this: 1. mangle classes, 2. remove pointless classes
    – Maros Hluska
    Nov 13 '18 at 8:45










  • I don't think anyone has implemented this. Feel free to be the first.
    – Gaurav
    Nov 15 '18 at 18:47
















  • I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
    – jelhan
    Nov 10 '18 at 11:34










  • @jelhan what's the reason?
    – Maros Hluska
    Nov 10 '18 at 11:58










  • Could you please add your use case? I'm not quite sure if I understand why you want to remove these IDs and class names.
    – jelhan
    Nov 12 '18 at 8:20










  • @jelhan the use case is given in the question: "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.". I do SSR with FastBoot. But an SSR request is slow (avg. 1 second) so I use Redis caching to speed it up. But I have lots of pages in Redis and I don't want to buy a larger Redis instance, thus I need smaller payloads in Redis. A couple techniques to achieve this: 1. mangle classes, 2. remove pointless classes
    – Maros Hluska
    Nov 13 '18 at 8:45










  • I don't think anyone has implemented this. Feel free to be the first.
    – Gaurav
    Nov 15 '18 at 18:47















I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
– jelhan
Nov 10 '18 at 11:34




I wouldn't consider your example classes and IDs useless. They are added by the framework you are using for a reason.
– jelhan
Nov 10 '18 at 11:34












@jelhan what's the reason?
– Maros Hluska
Nov 10 '18 at 11:58




@jelhan what's the reason?
– Maros Hluska
Nov 10 '18 at 11:58












Could you please add your use case? I'm not quite sure if I understand why you want to remove these IDs and class names.
– jelhan
Nov 12 '18 at 8:20




Could you please add your use case? I'm not quite sure if I understand why you want to remove these IDs and class names.
– jelhan
Nov 12 '18 at 8:20












@jelhan the use case is given in the question: "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.". I do SSR with FastBoot. But an SSR request is slow (avg. 1 second) so I use Redis caching to speed it up. But I have lots of pages in Redis and I don't want to buy a larger Redis instance, thus I need smaller payloads in Redis. A couple techniques to achieve this: 1. mangle classes, 2. remove pointless classes
– Maros Hluska
Nov 13 '18 at 8:45




@jelhan the use case is given in the question: "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.". I do SSR with FastBoot. But an SSR request is slow (avg. 1 second) so I use Redis caching to speed it up. But I have lots of pages in Redis and I don't want to buy a larger Redis instance, thus I need smaller payloads in Redis. A couple techniques to achieve this: 1. mangle classes, 2. remove pointless classes
– Maros Hluska
Nov 13 '18 at 8:45












I don't think anyone has implemented this. Feel free to be the first.
– Gaurav
Nov 15 '18 at 18:47




I don't think anyone has implemented this. Feel free to be the first.
– Gaurav
Nov 15 '18 at 18:47

















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',
autoActivateHeartbeat: false,
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















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




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















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)