import WPMDBCommon from './src/js/helpers/wpmdbCommon';

window.wpmdb = {
	functions : {},
	common : {
		hooks: [],
		call_stack: [],
		non_fatal_errors: '',
		migration_error: false
	}
};

wpmdb.functions = new WPMDBCommon();

function importAll( require ) {
	require.keys().forEach( function( file ) {
		// Don't load modules folder as there are already 'requires()` in place
		if ( -1 === file.indexOf( 'wpmdbCommon.js' ) && -1 === file.indexOf('./js/modules/') ) {
			require( file );
		}
	} );
}

importAll(
	require.context(
		'imports-loader?$=>window.jQuery!./src', true, /^(.*\.(js|sass|scss$))/im
	)
 );
