Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
laravel-elixir-wiredep
Advanced tools
#Laravel-Elixir-Wiredep
This is a simple wrapper around Laravel Elixir for Wiredep.
Install the module with npm:
laravel-elixir >v3.x
$ npm install --save-dev laravel-elixir-wiredep
laravel-elixir < v2.x
$ npm install --save-dev laravel-elixir-wiredep@2.x-release
And add it to your Elixir-enhanced Gulpfile, like so:
var elixir = require('laravel-elixir');
require('laravel-elixir-wiredep');
elixir(function(mix) {
mix.wiredep();
});
Then you just have to edit your php file(s) and some extra markup, like this:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<!-- bower:css -->
<!-- endbower -->
</head>
<body>
<!-- bower:js -->
<!-- endbower -->
</body>
</html>
This will scan your Bower dependencies on bower.json
and inject them in all your .php
files inside resources/views/
directory. Instead, if you only want to inject dependencies on a single file, you may do:
mix.wiredep({src: 'master.blade.php'})
If you run gulp watch this will also watch your bower.json
for any changes and inject them automatically.
Whenever you install a new bower package with the -S
command your php files will be updated.
Since Wiredep serves bower components, these must inside the public folder.
Just create a .bowerrc
file in the root of your project folder and specify the destination folder inside the public folder, like so:
{
"directory" : "public/bower_components"
}
This wrapper accepts two objects with configurations, the first one is for the wrapper itself and second one is for the Wiredep package you can get more info here
These are the default wrapper options:
{
baseDir: 'resources/views/', //the folder for your views
src: false, //if you just want to inject dependencies on one file just specify it's source, relative to baseDir
searchLevel: '**/*.php' //How many search levels you want
}
This is an example of a Gulp file that Wiredeps only your javascript dependencies and compiles your custom Sass file into the resources/views/master.blade.php
:
var elixir = require('laravel-elixir');
require('laravel-elixir-wiredep');
var paths = {
'bootstrap': './public/bower_components/bootstrap-sass-official/assets/'
}
elixir(function(mix) {
mix.sass('main.scss', 'public/css/', {includePaths: [paths.bootstrap + 'stylesheets/']})
.wiredep({src: 'master.blade.php'});
});
FAQs
Laravel Elixir Wiredep extension
We found that laravel-elixir-wiredep demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.