How do I minify CSS classnames with Ember CLI?
up vote
1
down vote
favorite
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
add a comment |
up vote
1
down vote
favorite
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
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
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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
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
css ember.js ember-cli
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
add a comment |
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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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