const mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/assets/js/app.js', 'public/js')
    .sass('resources/assets/sass/app.scss', 'public/css')
    .css('resources/assets/css/app.css','public/css')
    .sourceMaps();

mix.scripts([
    'resources/assets/js/ace.js',
    'resources/assets/js/jsoneditor.js',
], 'public/js/editor.js');

mix.scripts([
    'resources/assets/js/datepicker.min.js',
    'resources/assets/js/waves.min.js',
    'resources/assets/js/dual-listbox.js',
    'resources/assets/js/jquery.maskedinput.min.js',
], 'public/js/all.js');

mix.scripts([
    'node_modules/inspire-tree/dist/inspire-tree.min.js',
    'node_modules/inspire-tree-dom/dist/inspire-tree-dom.min.js'
], 'public/lib/inspire-tree/js/inspire-tree.js');

mix.sass('node_modules/inspire-tree-dom/src/scss/tree.scss',
    'public/lib/inspire-tree/css/inspire-tree.css'
);

mix.styles([
    'resources/assets/css/datepicker.min.css',
    'resources/assets/css/waves.min.css',
    'resources/assets/css/dual-listbox.css',
], 'public/css/all.css');

mix.copy('resources/assets/additions/chosen-sprite.png', 'public/css')
    .copy('resources/assets/additions/chosen-sprite@2x.png', 'public/css')
    .copy('resources/assets/js/tree-diagram.js', 'public/js')

mix.copyDirectory('resources/assets/additions/images', 'public/css/images')
    .copyDirectory('resources/assets/css/img', 'public/css/img')
    .copyDirectory('resources/assets/additions/tinymce', 'public/js/tinymce')
    .copyDirectory('resources/assets/img', 'public/img')
    .copyDirectory('resources/assets/additions/edit_area','public/lib/edit_area')
    .copyDirectory('resources/assets/additions/bpmn-js','public/lib/bpmn-js')
    .copyDirectory('resources/assets/additions/bpmn-js-properties-panel','public/lib/bpmn-js-properties-panel')
    .copyDirectory('resources/assets/additions/simplemde','public/lib/simplemde')
    .copyDirectory('resources/assets/additions/alpine', 'public/lib/alpine');

