// use commonjs for now
let $ = require( 'jquery' );

module.exports = function plugit( pluginName, pluginClass ) {
	let dataName = `plugin_${pluginName}`;

	$.fn[pluginName] = function( options ) {
		return this.each( function() {
			let $this = $( this );
			let data = $this.data( dataName );

			if ( ! data ) {
				$this.data( dataName, ( data = new pluginClass( this, options ) ) );
			}
		} );
	};

}

import $ from 'jquery';

module.exports = function plugit( pluginName, pluginClass ) {
	let dataName = `plugin_${pluginName}`;

	$.fn[pluginName] = function( options ) {
		return this.each( function() {
			let $this = $( this );
			let data = $this.data( dataName );

			if ( ! data ) {
				$this.data( dataName, ( data = new pluginClass( this, options ) ) );
			}
		} );
	};

}

Revert "Use commonjs for now"
Revert "Use commonjs for now"

This reverts commit b725e743c11515ea6da44ad0a6219a671d3c8bd7.
