Laravel is pre-configured to use Node and Gulp (wrapped in Laravel elixir
) to manage and build front-end assets.
Node is used to manage dependencies.
Quick Start Bootstrap
- In the project root run
npm install
to fetch the packages defined in package.json
- Enter
gulp
to run the default elixir task
- Bootstrap SASS files will be built in to
resources/assets/sass/app.scss
- There is a font
@import
rule in resources/assets/sass/app.scss
- more efficient to import fonts via HTML
- Starter variables file at
resources/assets/sass/variables.scss
Set Node Version
A modern node is required - if necessary use nvm
to load in a suitable version:
See nvm for more.
Versioning
Amend Gulpfile.js
:
Reference the versioned CSS file in a blade view - possibly resources/views/partials/head.blade.php
:
Reference the versioned JavaScript file in a blade view - possibly resources/views/partials/footer.blade.php
: