/* global require, __dirname, process */

const
	{ mix } = require('laravel-mix'),
	webpack = require('webpack'),
	path = require('path'),
	SvgStorePlugin = require('external-svg-sprite-loader/lib/SvgStorePlugin');

mix.webpackConfig({
	module: {
		rules: [
			{
				test: /\.svg$/,
				enforce: 'pre',
				exclude: /node_modules/,
				loader: 'external-svg-sprite-loader'
			}
		]
	},

	plugins: [
		new webpack.ProvidePlugin({
			$: 'jquery',
			jQuery: 'jquery',
			'window.jQuery': 'jquery',
			'Tether': 'tether',
			'window.axios': 'axios'
		}),
		new SvgStorePlugin()
	],

	resolve: {
		symlinks: false,
		alias: {
			CMS_ALIAS: path.resolve(__dirname, 'resources/assets/js'),
			IconPath: path.resolve(__dirname, 'resources/assets/icons')
		}
	}
});


/*
 |--------------------------------------------------------------------------
 | 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')
	.extract([
		'axios',
		'chart.js',
		'element-ui',
		'jquery',
		'lodash',
		'velocity-animate',
		'vue',
		'vue-chartjs',
		'vue-router',
		'vuedraggable',
		'vuex'
	])
	.sourceMaps();

	// .copy(
	// 	'node_modules/kent-bar/build/deploy/assets/app.js',
	// 	'public/js/kent-bar.js'
	// )
	// .copy(
	// 	'node_modules/kent-bar/build/deploy/assets/main.css',
	// 	'public/css/kent-bar.css'
	// )

mix.browserSync(process.env.APP_HOST || 'localhost');

@@ -206,16 +206,91 @@
 Plugin')
+,%0A%09resolve = (dir) =%3E path.resolve(__dirname, %60resources/assets/js/$%7Bdir%7D%60)
 ;%0A%0Amix.w
@@ -697,62 +697,257 @@
 %0A%09%09%09
-CMS_ALIAS: path.resolve(__dirname, 'resources/assets/j
+classes:    resolve('classes'),%0A%09%09%09components: resolve('components'),%0A%09%09%09directives: resolve('directives'),%0A%09%09%09mixins:     resolve('mixins'),%0A%09%09%09plugins:    resolve('plugins'),%0A%09%09%09store:      resolve('store'),%0A%09%09%09views:      resolve('components/view
 s'),
@@ -959,16 +959,18 @@
 conPath:
+  
  path.re

Add aliases for nicer paths and so things can be moved around a bit easier.