2

I am trying to get compass to work in laravel 5.4, I have a existing project in laravel 5.4, I have upgraded to 5.4 and it no longer uses elixir. This is what i was using on 5.3 is there away i can still use compass so i dont have to start over again in my 5.3 project

var elixir = require('laravel-elixir');
require('laravel-elixir-sass-compass');

elixir(function(mix) {
    mix.compass("resources/assets/sass/styles.scss", "public/css", {
        // style: "nested",
        sass: "resources/assets/sass",
        font: "resources/assets/fonts",
        image: "resources/assets/image",
        javascript: "resources/assets/scripts",
        sourcemap: true
    });
});

i have loads of scripts in compass and would like to stay using it if possible. Thanks

Jamie Rose
  • 41
  • 4
  • I see you've figured this out yourself already. One tip: Laravel Mix (formerly Laravel Elixir) ships with `autoprefixer` (https://github.com/postcss/autoprefixer) out of the box. I know this is one of the reasons why people use Compass. I recommend doing some research to try and see if you can replace your Compass calls with your own. – Marijke Luttekes May 10 '17 at 20:57
  • ok great i will look into that. thank you – Jamie Rose May 10 '17 at 21:41

1 Answers1

1

Ok i manged to fix this only took two days. first of all install compass mixings using npm install mixin-loader --save-dev

then in your app.scss add @import "~compass-mixins/lib/compass";

Then make sure you add <link href="{{asset('css/app.css')}}" rel="stylesheet"> to your

run npm run watch

this worked for me hope.

Jamie Rose
  • 41
  • 4
  • 4
    Hi, would love to add more details on how you solved it as I have the exact same problem. What should the `webpack.mix.js` file looks like? – DODMax May 16 '17 at 08:14