Closed
Description
Most web projects are now using modules bundler (such as Webpack, System.js, JSPM, etc.) for building assets. This would be good to make the use of Fancytree easier with these bundlers. This is how I managed to use Fancytree (in the most simple way) with Webpack, which feels quite awkward, even so it works:
const jQuery = require('jquery')
//minimal required jquery-ui modules
require('jquery-ui/core')
require('jquery-ui/widget')
require('jquery-ui/effect-blind')
//import of fancytree by injecting jquery
require('imports?jQuery=jquery!jquery.fancytree/dist/jquery.fancytree.js')
//potential extensions (by injecting jquery as well)
require('imports?jQuery=jquery!jquery.fancytree/src/jquery.fancytree.childcounter.js')
//from here we can now use jQuery#fancytree
While jQuery does not play very well with any module bundler, an easy improvement idea would be to do something similar to jqueryUi, by requiring jquery automatically, instead of assuming jQuery as a global variable.
E.g. jquery-ui/core.js looks like that:
var jQuery = require('jquery');
(function( $, undefined ) {
//...
})( jQuery );