Created
March 27, 2015 20:10
-
-
Save jholl/34e419a42040f24f7562 to your computer and use it in GitHub Desktop.
gulpfile for laravel angular bower build
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
var elixir = require('laravel-elixir'); | |
var paths = { | |
'bower': './vendor/bower_components/' | |
}; | |
var paths = { | |
'fonts': 'resources/assets/fonts/', | |
'img': 'resources/assets/img/', | |
'svg': 'resources/assets/svg', | |
'sass': 'resources/assets/sass/', | |
'js': 'resources/assets/js/', | |
'angular_assets': 'resources/assets/js/angular/', | |
'bootstrap': paths.bower + 'bootstrap-sass-official/assets/', | |
'angular': paths.bower + "angular/", | |
'angular_resource': paths.bower + "angular-resource/", | |
'angular_route': paths.bower + "angular-route/", | |
'angular_animate': paths.bower + "angular-animate/", | |
'angular_touch': paths.bower + "angular-touch/", | |
'angular_sanitize': paths.bower + "angular-sanitize/", | |
'angular_cookies': paths.bower + "angular-cookies/", | |
'dist': 'public/', | |
'dist_fonts': 'public/fonts/', | |
'dist_img': 'public/img/', | |
'dist_svg': 'public/svg/', | |
'dist_css': 'public/css/', | |
'dist_js': 'public/js/' | |
}; | |
/* | |
|-------------------------------------------------------------------------- | |
| Elixir Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Elixir provides a clean, fluent API for defining some basic Gulp tasks | |
| for your Laravel application. By default, we are compiling the Less | |
| file for our application, as well as publishing vendor resources. | |
| | |
| A note on Bootstrap: source files via bower copy to assets/sass/bootstrap | |
| keep an updated manifest file sass/app.scss which calls the resources | |
| from the assets/sass/bootstrap folder (not the bower one). Sprinkle | |
| in custom scss files and variable over rides within any order of | |
| the manifest. | |
*/ | |
elixir(function (mix) { | |
// Styles | |
mix | |
// App + Bootstrap | |
.sass("app.scss"); | |
// Scripts | |
mix | |
// App | |
.scriptsIn(paths.angular_assets, paths.dist_js + "appng.js") | |
// Third-party | |
.scripts([ | |
paths.angular + "angular.min.js", | |
paths.angular_resource + "angular-resource.min.js", | |
paths.angular_route + "angular-route.min.js" | |
//paths.angular_animate + "angular-animate.min.js", | |
//paths.angular_touch + "angular-touch.min.js", | |
//paths.angular_sanitize + "angular-sanitize.min.js", | |
//paths.angular_cookies + "angular-cookies.min.js" | |
], paths.dist_js + "vendor.js", "./"); | |
// Copy | |
mix | |
.copy(paths.bootstrap + 'stylesheets/bootstrap/', paths.sass + 'bootstrap/') | |
.copy(paths.bootstrap + 'fonts/bootstrap/', paths.dist_fonts) | |
.copy(paths.fonts, paths.dist_fonts) | |
.copy(paths.img, paths.dist_img); | |
// Versioning | |
mix | |
.version([ | |
"css/app.css", | |
"js/app.js", | |
"js/vendor.js", | |
"js/appng.js" | |
]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment