Template to generate a new standard and simple project using Laravel 10.x, Bootstrap 5.x and SCSS (SASS with SCSS Syntax).
-
Remove POSTCSS from our application
npm remove postcss -
Execute
npm i -
Install SASS
npm i --save-dev sass -
Update both css file and folder to scss:
- Rename
resources/cssintoresources/scss- Rename
app.cssintoapp.scss
- Rename
- Rename
-
Edit
vite.config.jsfile:export default defineConfig({ plugins: [ laravel({ input: [ 'resources/scss/app.scss', 'resources/js/app.js', ], refresh: true }), ], resolve: { alias: { '~resources' : '/resources/', } } }); -
Add
import '~resources/scss/app.scss'toresources/app/js -
Add
@vite('resources/js/app.js')to the pages that want to implement it (layouts included, eventually) -
Add to
resources/app/jsthis block of code to allow the correct renderization of our imagesimport.meta.glob([ '../img/**' ]) -
Add
package-lock.jsonto.gitignorefile -
Install and configure Bootstrap:
- Install both bootstrap and popperjs packages
npm i --save bootstrap @popperjs/core - Add bootstrap js via import
import * as bootstrap from 'bootstrap';to ourresources/app.js - Add boostrap scss via @import
@import "../../node_modules/bootstrap/scss/bootstrap";to ourresources/app.scss
- Install both bootstrap and popperjs packages
- Open this repository and click on
Use this template ---> Create a new repository - Clone the repository wherever you want to develop, e.g.
VS Code,VSCodium, ecc. - Open the cloned folder with a
terminal - Copy and paste the
.env.examplefile and rename it into.envwithout removing theenv.examplefile - Run
composer installto install all our composer packages - Run
php artisan key:generateto generate our custom application key - Run
npm ito install all our npm packages - Run on two separeted terminals:
- run
npm run devto build iteratively our front-end packages and code - run
php artisan serveto build iteratively our back-end packages and code
- run
- Start changing the world with your oustanding code!
