Created
March 17, 2016 22:21
-
-
Save FDiskas/48864a36590a4d8e7146 to your computer and use it in GitHub Desktop.
laravel-elixir + laravel-elixir-wiredep + laravel-elixir-useref + asset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"directory": "public/assets/vendor" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"ignore": [ | |
"**/.*", | |
"node_modules", | |
"bower_components", | |
"test", | |
"tests" | |
], | |
"dependencies": { | |
"bootstrap-sass": "^3.3.6", | |
"bootstrap-select-sass": "^1.6.3" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('laravel-elixir'); | |
require('laravel-elixir-wiredep'); | |
require('laravel-elixir-useref'); | |
var options = { | |
fileTypes: { | |
php: { | |
block: /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi, | |
detect: { | |
js: /<script.*src=['"]([^'"]+)/gi, | |
css: /<link.*href=['"]([^'"]+)/gi | |
}, | |
replace: { | |
js: '<script src="{{ asset(\'{{filePath}}\') }}"></script>', | |
css: '<link rel="stylesheet" href="{{ asset(\'{{filePath}}\') }}" />' | |
} | |
} | |
} | |
}; | |
elixir(function (mix) { | |
mix | |
.sass(['app.scss']) | |
.browserify('app.js') | |
.wiredep('php', {src: 'layouts/app.blade.php'}, options) | |
.useref() | |
.version(['js/vendors.min.js', 'css/vendors.min.css']); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"devDependencies": { | |
"gulp": "^3.8.8" | |
}, | |
"dependencies": { | |
"laravel-elixir": "^4.0.0", | |
"laravel-elixir-useref": "^1.2.1", | |
"laravel-elixir-wiredep": "^2.1.0", | |
"useref": "git+https://github.com/CodersAKL/useref.git#master" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place for the website js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bower:scss | |
// endbower |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Laravel</title> | |
<base href="{{ config('app.url') }}"> | |
@if ( Config::get('app.debug') ) | |
<!-- build:css(public) css/vendors.min.css --> | |
<!-- bower:css --> | |
<!-- endbower --> | |
<link rel="stylesheet" href="{{ asset('css/app.css') }}"> | |
<!-- endbuild --> | |
@else | |
<link rel="stylesheet" href="{{ elixir("css/styles.min.css") }}"> | |
@endif | |
</head> | |
<body id="app-layout"> | |
@yield('content') | |
@if ( Config::get('app.debug') ) | |
<!-- build:js(public) js/vendors.min.js --> | |
<!-- bower:js --> | |
<!-- endbower --> | |
<script src="{{ asset('js/app.js') }}"></script> | |
<!-- endbuild --> | |
@else | |
<script src="{{ elixir('js/scripts.min.js') }}"></script> | |
@endif | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment