server/src/gulpfile.js
author ymh <ymh.work@gmail.com>
Tue, 01 Dec 2015 13:33:08 +0100
changeset 20 a9b98b16b053
parent 4 f55970e41793
child 28 b0b56e0f8c7f
permissions -rw-r--r--
add contributor list + edition pane
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     1
var gulp = require('gulp'),
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     2
    elixir = require('laravel-elixir');
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     4
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     5
var exec = require('child_process').execSync;
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
/*
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 |--------------------------------------------------------------------------
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 | Elixir Asset Management
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 |--------------------------------------------------------------------------
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 |
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
 | for your Laravel application. By default, we are compiling the Less
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 | file for our application, as well as publishing vendor resources.
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 |
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 */
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    17
 var paths = {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    18
 'bower_base_path': './vendor/bower_components/',
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    19
 'bootstrap': './vendor/bower_components/bootstrap-sass/assets/'
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    20
 };
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    21
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    22
gulp.task('build-ember', function(cb) {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    23
    exec('node_modules/.bin/ember build -prod', {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    24
        cwd: '../bo_client',
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    25
        stdio:[0,1,2]
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    26
    });
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    27
});
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    28
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    29
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    30
gulp.task('copy-bo-ember', function() {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    31
    gulp.src('../bo_client/dist/assets/*.js')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    32
        .pipe(gulp.dest('public/js/vendor/'));
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    33
    gulp.src('../bo_client/dist/assets/*.css')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    34
        .pipe(gulp.dest('public/css/vendor/'));
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    35
});
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    36
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
elixir(function(mix) {
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    38
    mix.sass('app.scss', 'public/css/app.css', {includePaths: [paths['bootstrap']+'stylesheets/']})
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    39
        .copy(paths.bootstrap + 'fonts/bootstrap', 'public/fonts')
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    40
        .copy(paths.bootstrap + 'javascripts/bootstrap.js', 'public/js/vendor/bootstrap.js')
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    41
        .copy(paths.bower_base_path + 'jquery/dist/jquery.min.js', 'public/js/vendor/jquery.js')
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    42
        .copy(paths.bower_base_path + 'font-awesome/css/font-awesome.min.css', 'public/css/vendor/font-awesome.css')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    43
        .task('build-ember')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    44
        .task('copy-bo-ember');
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
});