opilo's avatar

Elixir doesn't minify

Hi. Here's my config:

 mix.less(["smartadmin-production.less","bootstrap.less"])
        .styles([
            "css/bootstrap.css",
            "css/smartadmin-production.css"
        ]).version("css/all.css")
       .routes()
       .events();

Any idea how i can get the minified version of my files?

0 likes
8 replies
opilo's avatar

Is there any option to remove comments?

7 likes
alexhiggins's avatar

I have issues with the minified version on mine. It's fine on the uncompressed version.

Once I minify the stylesheets something goes wrong like it's missing some CSS or some ordering is wrong as the styles go all to pot on the site.

This does not happen If i use just a compressor of a random site so I think there's something up with the tool that's used to do it.

alexhiggins's avatar
var elixir = require('laravel-elixir');

elixir(function(mix) {
    mix.sass("app.scss")
        .scripts([''], 'resources/assets/js/');
});

in that app.scss that's got the @imports - it's fine when it does the normal version but the compression messes it up :S

update* The best pointer I can give at the moment is it will be most likely something within the boostrap Sass package that it's not agreeing with (http://getbootstrap.com/getting-started/) which really isn't much because it's pretty big...

jokerplaying's avatar

Hi Heffer My Gulp --production throws error : /var/www/html/gallery/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/plugins/cleanupIDs.js:123 for (var ID of referencesIDs) { ^^ SyntaxError: Unexpected identifier at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at /var/www/html/gallery/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo/config.js:99:33 at Array.map (native) at preparePluginsArray (/var/www/html/gallery/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo/config.js:64:20) at module.exports (/var/www/html/gallery/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo/config.js:32:28) at new module.exports (/var/www/html/gallery/node_modules/laravel-elixir/node_modules/gulp-cssnano/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo.js:21:19)

Please or to participate in this conversation.