New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

laravel-elixir-wiredep

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-elixir-wiredep

Laravel Elixir Wiredep extension

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#Laravel-Elixir-Wiredep

This is a simple wrapper around Laravel Elixir for Wiredep.

Getting Started

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.

NOTE

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"
}

Options

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

}

Example

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'});
});

Keywords

FAQs

Package last updated on 04 Sep 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc