-
Notifications
You must be signed in to change notification settings - Fork 401
/
gulpfile.js
62 lines (54 loc) · 1.93 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'use strict';
const elixir = require('laravel-elixir');
require('laravel-elixir-eslint');
require('./tasks/swPrecache.task.js');
require('./tasks/bower.task.js');
// setting assets paths
elixir.config.assetsPath = './';
elixir.config.css.folder = 'angular';
elixir.config.css.sass.folder = 'angular';
elixir.config.js.folder = 'angular';
/*
|--------------------------------------------------------------------------
| 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 Sass
| file for our application, as well as publishing vendor resources.
|
*/
let assets = [
'public/js/final.js',
'public/css/final.css'
],
scripts = [
'public/js/vendor.js', 'public/js/app.js'
],
styles = [
// for some reason, ./ prefix here works fine!
// it is needed to override elixir.config.css.folder for styles mixin
'./public/css/vendor.css', './public/css/app.css'
],
karmaJsDir = [
'public/js/vendor.js',
'node_modules/angular-mocks/angular-mocks.js',
'node_modules/ng-describe/dist/ng-describe.js',
'public/js/app.js',
'tests/angular/**/*.spec.js'
];
elixir(mix => {
mix.bower()
.copy('angular/app/**/*.html', 'public/views/app/')
.copy('angular/dialogs/**/*.html', 'public/views/dialogs/')
.webpack('index.main.js', 'public/js/app.js')
.sass(['**/*.scss', 'critical.scss'], 'public/css')
.sass('critical.scss', 'public/css/critical.css')
.styles(styles, 'public/css/final.css')
.eslint('angular/**/*.js')
.combine(scripts, 'public/js/final.js')
.version(assets)
.swPrecache();
//enable front-end tests by adding the below task
// .karma({jsDir: karmaJsDir});
});