var elixir = require('laravel-elixir');

require('laravel-elixir-sass-compass');

/*
 |--------------------------------------------------------------------------
 | 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.
 |
 */

// Disable sourcemaps globally
elixir.config.sourcemaps = false;
elixir.config.js.uglify.options.mangle = false;

elixir(function (mix) {
    mix.compass('main.scss', 'public/css', {
        sass: "resources/assets/scss",
        image: "public/images",
        config_file: "config.rb"
    });

    mix.compass('print_sheets.scss', 'public/css', {
        sass: "resources/assets/scss",
        config_file: "config.rb"
    });

    // Custom styling
    mix.compass('custom_style.scss', 'public/css', {
        sass: "resources/assets/scss",
        config_file: "config.rb"
    });

    mix.styles([
        '../vendor/jqueryui/jqueryui.min.css',
        '../vendor/messenger/css/messenger.css',
        '../vendor/messenger/css/messenger-theme-future.css',
        '../vendor/bootstrap-switch/static/stylesheets/bootstrapSwitch.css',
        '../vendor/tabdrop/css/tabdrop.css',
        '../vendor/fullcalendar/fullcalendar.css',
        '../vendor/daterangepicker/daterangepicker-bs3.css',
        '../vendor/summernote/*.css',
        '../vendor/angular-xeditable/css/*.css',
        '../vendor/gantt/*.css',
        '../vendor/select2/select2.css',
        '../vendor/select2/select2-bootstrap.css',
        '../vendor/angular-ui-grid/ui-grid.css',
        '../vendor/chartjs/angular-chart.css',
        '../vendor/sweetalert/sweetalert.css',
        '../vendor/angular-ui-select/dist/select.min.css',
        '../vendor/font-awesome/css/font-awesome.css'
    ]);

    mix.scripts('../vendor/typeahead.js/typeahead.min.js');

    // Compile vendor scripts - EXACTLY as in Laravel5
    mix.scripts([
        '../vendor/libs/jquery.min.js',
        '../vendor/libs/underscore.min.js',
        '../vendor/jqueryui/jqueryui.min.js',
        '../vendor/bootstrap-sass/assets/javascripts/bootstrap.min.js',
        '../vendor/angular/angular.min.js',
        '../vendor/angular-resource/angular-resource.min.js',
        '../vendor/angular-route/angular-route.min.js',
        '../vendor/angular-sanitize/angular-sanitize.min.js',
        '../vendor/angular-bootstrap/ui-bootstrap.min.js',
        '../vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',
        '../vendor/libs/*.js',
        '../vendor/messenger/js/messenger.min.js',
        '../vendor/messenger/js/messenger-theme-future.js',
        '../vendor/bootstrap-switch/static/js/bootstrapSwitch.js',
        '../vendor/tabdrop/js/bootstrap-tabdrop.js',
        '../vendor/fullcalendar/fullcalendar.min.js',
        '../vendor/daterangepicker/daterangepicker.js',
        '../vendor/daterangepicker/ng-daterangepicker.js',
        '../vendor/summernote/*.js',
        '../vendor/blueimp/*.js',
        '../vendor/angular-xeditable/js/*.min.js',
        '../vendor/gantt/*.min.js',
        '../vendor/textcomplete/*.js',
        '../vendor/select2/*.js',
        '../vendor/ui-utils/*.js',
        '../vendor/desktop-notifications/*.js',
        '../vendor/mentio/*.js',
        '../vendor/elastic/*.js',
        '../vendor/angular-ui-grid/ui-grid.min.js',
        '../vendor/chartjs/chart.min.js',
        '../vendor/chartjs/angular-chart.js',
        '../vendor/sweetalert/sweetalert.min.js',
        '../vendor/sweetalert/ng-sweetalert.js',
        '../vendor/angular-ui-select/dist/select.min.js'
    ], 'public/js/vendor.js');

    // Compile application specific scripts - EXACTLY as in Laravel5
    mix.scripts([
        'archDB.js',
        'directives.js',
        'services.js',
        'menu/**/*.js',
        'bookings/**/*.js',
        'clients/**/*.js',
        'dashboard/**/*.js',
        'dashboard_v2/**/*.js',
        'sales/**/*.js',
        'invoices/**/*.js',
        'notifications/**/*.js',
        'stats/**/*.js',
        'stock/**/*.js',
        'accounts/**/*.js',
        'admin/**/*.js',
        'asterisk/**/*.js',
        'workflow/**/*.js',
        'hr/**/*.js',
        'chat/**/*.js',
        'reminders/**/*.js'
    ], 'public/js/app.js');
}); 