Marco Marco -3 years ago 90
PHP Question

Using elixir in Lumen

Is it possible to use elixir in lumen like in Laravel?
I have tried by making package.json and gulpfile.js same as in Laravel, as suggested on one forum, but after running gulp I got the error:


Cannot find module 'laravel-elixir'


Package.json

{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"bootstrap-sass": "^3.0.0"
}
}


Gulpfile.js

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

elixir(function(mix) {
mix.sass('sass/app.scss', './public/css/app.css')
});

Answer Source

Yes, you can use Elixir with Lumen. Concerning the issue, it sounds like you need to run npm install from the root directory (containing your package.json file).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download