How to integrate Laravel Elixir with Compass?
仅有的幸福
仅有的幸福 2017-05-16 16:51:35
0
1
529

The gulpfile.js of Laravel 5.3 is like this:

var elixir = require('laravel-elixir'); require('laravel-elixir-vue'); elixir(function(mix) { mix.sass('app.scss') .webpack('app.js'); });

The above can directly compile and compress scss and js. The question is if the scss file is written with compass, how should it be compiled?
Tried "laravel-elixir-sass-compass": "^0.5.0", this package seems to have not been updated for a long time, there is a problem with the installation:

$ npm install npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\dell\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v7.0.0-nightly2016080329e49fc286 npm ERR! npm v3.10.5 npm ERR! cb is not a function npm ERR! npm ERR! If you need help, you may report this error at: npm ERR!  npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\dell\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v7.0.0-nightly2016080329e49fc286 npm ERR! npm v3.10.5 npm ERR! cb is not a function npm ERR! npm ERR! If you need help, you may report this error at: npm ERR!  npm ERR! Please include the following file with any support request: npm ERR! D:\wnmp\www\laravel-5-3-demo\npm-debug.log
仅有的幸福
仅有的幸福

reply all (1)
刘奇

There is no problem installing this package. Personal testing is available.

npm install --save-dev laravel-elixir-sass-compass

After installation, write the following code in gulpfile.js

var elixir = require('laravel-elixir'); require('laravel-elixir-sass-compass'); elixir(function(mix) { mix.compass('app.scss'); });

Then execute npm run dev
There is something to note here
If the node version used is 6.0 or above, an error will be reported. You need to use version 6.0 or later
I use the n tool to manage my own node version. I installed 5.11.0 and it can be used

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!