Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled SCSS doesn't get minified #612

Closed
JonasDoebertin opened this issue Mar 23, 2017 · 3 comments
Closed

Compiled SCSS doesn't get minified #612

JonasDoebertin opened this issue Mar 23, 2017 · 3 comments

Comments

@JonasDoebertin
Copy link

  • Laravel Mix Version: 0.8.9
  • Node Version: v7.1.0
  • NPM Version: 3.10.9
  • OS: macOS 10.12.3

Description:

Same issue as mentioned in #427 with SCSS and "laravel-mix": "^0.8.9".

Compiled scss doesn't get minified in production mode with this setup:

mix.setPublicPath('assets');

mix.options({
    processCssUrls: false
});

mix.js('src/js/main.js', 'assets/js')
   .sass('src/sass/main.scss', 'assets/css')
   .extract(['jquery', 'basiclightbox', 'classlist-polyfill'])
   .sourceMaps()
   .version();

If I comment out the mix.options() call, it gets minified properly.

JS get's minified properly.

@JonasDoebertin
Copy link
Author

Just updated to 0.9.2 and this issue seems to be fixed.

On a related note: I tend to miss that there's a new version of mix if it's not listed as a release on Github. Are there specific reasons for not tagging them here? Or better, only tagging some releases?

@ankurk91
Copy link
Contributor

For now try this -

  mix.sass('src/sass/main.scss', 'assets/css', {
    outputStyle: mix.inProduction ? 'compressed' : 'expanded'
  })

When in production mix should always set outputStyle to compressed by default.

@JonasDoebertin
Copy link
Author

@ankurk91 Thank you! Came to that conclusion as well. But as I said, upgrading to 0.9.2 solved the issue for me.

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

No branches or pull requests

2 participants