webpack.mix.js 1.68 KB
Newer Older
1
const mix = require('laravel-mix');
2 3 4 5 6 7 8
const WebpackShellPlugin = require('webpack-shell-plugin');
const themeInfo = require('./theme.json');


/**
 * Compile less
 */
9
mix.less('resources/assets/less/asgard.less', 'assets/css/asgard.css');
10 11 12 13 14


/**
 * Copy scripts
 */
15 16 17 18 19
mix.copy('resources/assets/js/main.js', 'assets/js/main.js');

/**
 * Compile js and scss
 */
Nicolas Widart's avatar
Nicolas Widart committed
20 21
// mix.js('resources/assets/js/asgardcms.js', 'assets/js/asgardcms.js');
// mix.sass('resources/assets/scss/asgardcms.scss', 'assets/css/asgardcms.css');
22 23 24 25

/**
 * Copy node module
 */
26
mix.copyDirectory('node_modules/admin-lte', 'assets/vendor/admin-lte');
27 28 29 30 31
// mix.copyDirectory('node_modules/animate.css', 'assets/vendor/animate.css');
// mix.copyDirectory('node_modules/bootstrap', 'assets/vendor/bootstrap');
// mix.copyDirectory('node_modules/clipboard', 'assets/vendor/clipboard');
// mix.copyDirectory('node_modules/datatables.net', 'assets/vendor/datatables.net');
// mix.copyDirectory('node_modules/datatables.net-bs', 'assets/vendor/datatables.net-bs');
Nicolas Widart's avatar
Nicolas Widart committed
32
mix.copyDirectory('node_modules/font-awesome', 'assets/vendor/font-awesome');
33 34 35 36 37 38
// mix.copyDirectory('node_modules/gridstack', 'assets/vendor/gridstack');
// mix.copyDirectory('node_modules/icheck', 'assets/vendor/iCheck');
// mix.copyDirectory('node_modules/jquery', 'assets/vendor/jquery');
// mix.copyDirectory('node_modules/jquery-ui', 'assets/vendor/jquery-ui');
// mix.copyDirectory('node_modules/lodash', 'assets/vendor/lodash');
// mix.copyDirectory('node_modules/simplemde/src', 'assets/vendor/simplemde/src');
39 40 41 42 43

/**
 * Publishing the assets
 */
mix.webpackConfig({
44 45 46
    plugins: [
        new WebpackShellPlugin({ onBuildEnd: [`php ../../artisan stylist:publish ${themeInfo.name}`] }),
    ],
47
});