Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

css is not minified in production environment #47

Open
MartinMalinda opened this issue Apr 3, 2017 · 4 comments
Open

css is not minified in production environment #47

MartinMalinda opened this issue Apr 3, 2017 · 4 comments

Comments

@MartinMalinda
Copy link

running ember build --environment=production it is clear there's no css minification

@voltidev
Copy link

The same here.

@voltidev
Copy link

Just in case, here is a workaround, I'm using for now:

$ npm install --save-dev broccoli-clean-css

ember-cli-build.js:

'use strict';

const GlimmerApp = require('@glimmer/application-pipeline').GlimmerApp;
const CleanCss = require('broccoli-clean-css');

class CustomApp extends GlimmerApp {
  cssTree() {
    let originalTree = super.cssTree();
    let isProduction = this.env === 'production';
    return isProduction ? new CleanCss(originalTree) : originalTree;
  }
}

module.exports = function(defaults) {
  let app = new CustomApp(defaults, {
    fingerprint: {
      exclude: ['apple-touch-icon', 'favicon', 'mstile', 'android-chrome']
    }
  });

  return app.toTree();
};

@rwjblue
Copy link
Member

rwjblue commented Jul 15, 2017

Ya, the goal was for ember-cli-clean-css to do this automatically (which leverages broccoli-clean-css under the hood), but I forgot to do some final testing and publishing.

@tschoartschi
Copy link
Contributor

@ivanvotti thanks for the tip. I tried ember-cli-clean-css but it still does not work. Your solution did the trick for me :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants