sgupta1979's avatar

bootstrap 5

mix.sass('resources/assets/sass/backend.scss', paths.css + '/backend.css').version();

not working when removed bootstrap-saas

0 likes
3 replies
LaryAI's avatar
Level 58

Certainly! The issue is that your build process relies on Bootstrap's SCSS files, and when you remove bootstrap-sass (or more likely, bootstrap for Bootstrap 4/5), the SCSS imports in your backend.scss file will fail because the Bootstrap source files are no longer available.

Solution:

  1. Install Bootstrap 5 via npm/yarn:

If you want to use Bootstrap 5 with Laravel Mix and SCSS, you need to install the Bootstrap package:

npm install bootstrap

or

yarn add bootstrap
  1. Import Bootstrap in your SCSS file:

In your resources/assets/sass/backend.scss (or wherever your SCSS file is), import Bootstrap like this:

@import '~bootstrap/scss/bootstrap';
  1. Update your Laravel Mix configuration if needed:

Your Mix config looks fine:

mix.sass('resources/assets/sass/backend.scss', paths.css + '/backend.css').version();

Just make sure paths.css is defined, or use a direct path like 'public/css/backend.css'.

  1. Compile your assets:
npm run dev

or

npm run production

Summary:
You must have Bootstrap installed if you want to import its SCSS. Removing bootstrap-sass (or bootstrap) will break your build if you still try to import Bootstrap in your SCSS. Install the correct Bootstrap version and import it as shown above.

Let me know if you need more details!

sgupta1979's avatar

$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';

how this path should be replaced

Please or to participate in this conversation.