louisav
louisav

Reputation: 382

Laravel 5.3 bootstrap installed with bower not seen in view

On my Laravel 5.3 app I followed these steps (1, 2, 3, 5 and 6) So I now have a public/js/vendor.js folder. My view uses <script src="{{ asset('/js/vendor.js') }}"></script> I skipped step 4 in the tutorial since Laravel 5.3 doesn't have a less folder in resources.

Now, we need to update our scripts to pull in the new dependencies. In resources/less/app.less, change this:

Do I need to make changes to resources/assets/sass/app.scss instead? And what are those changes?

Or what is the best way to get bootstrap installed for Laravel 5.3 using bower and gulp?

My gulp.js:

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


elixir(function(mix){
mix.scripts([
'../bower/jquery/dist/jquery.js',
'../bower/bootstrap/dist/js/bootstrap.js'
], 
'public/js/vendor.js');
});

For step 4 I created a less folder in resources/assets. And created app.less. In it I've put @import "../bower/bootstrap/less/bootstrap"; gulp file: (has an error in now)

elixir(function(mix){
mix.scripts([
'../bower/jquery/dist/jquery.js',
'../bower/bootstrap/dist/js/bootstrap.js'
], 
'public/js/vendor.js');

mix.less(app.less);
});

Upvotes: 0

Views: 1049

Answers (1)

Jamie
Jamie

Reputation: 10906

Why did you skipped step 4? You could add for example

@import "bootstrap/bootstrap";

to: resources/assets/less/app.scss

Then in your gulp file:

elixir(mix => {
    mix.less('app.scss');
});

Hope this helps.

Upvotes: 1

Related Questions