2

Grunt-Haxe has been built around 3 years ago. Installing it along with NPM haxelib, did provide a way to compile pure JavaScript with one issue of not being able utilize JqueryExtern library; it simply throws an error each time when trying to use jQuery class saying it can't be found, even if adding import jQuery.*. It compiles *.Hx files fine with Haxetoolkit but same does not work with haxe-NPM, haxelib, grunt-haxe it just ignores the JqueryExtern library when compiling.

Here is my grunt configuration - do I have something there that is causing these failures? The haxe version I use is Haxe 3.2.1., I can't run gulp watch as it would require a task assigned for Haxe but that does not exist yet

   haxe: {
        complete_example: {
            main     : 'Main',
            classpath: [ app.src.hx],
            libs     : ['jQueryExtern' ], /*specify haxelib libraries */
            //flags    : [ 'something', 'createjs' ], /* define conditional compilation flags */
            //macros   : [ 'Mymacro.doSomethingCool()' ], /*call the given macro*/
            //resources: [ 'activity/xml/map-layout.json@map_layout' ], /*define named resource files*/
            //misc     : [ '-debug', "--dead-code-elimination", "--js-modern" ], /* add any other arguments*/
            output   : app.dest.js + 'hx.js',
            onError  : function ( e ) {
                /*custom error message */
                console.log( 'There was a problem...\n' + e );
            },
            force    : true /*continue processing task (like --force)*/
        }
    }
grunt.loadNpmTasks( 'grunt-haxe' );
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Andrius Solopovas
  • 967
  • 11
  • 41
  • There have been some [changes](https://github.com/HaxeFoundation/haxe/issues/4377) to the JQuery wrappers; what version of Haxe do you have? – Jonas Malaco Oct 13 '15 at 14:15
  • 1
    I don't use it myself, but can't you use gulp-watch and call `haxe build.hxml` when an hx file changes? Not sure if thats your question, cheers. – TiagoLr Oct 13 '15 at 14:21

1 Answers1

0

The only way I was able to compile it is by using file watchers plugin for intelliJ IDEA browser along with official version of haxe toolkit. No other plugins were found to do this job.

Andrius Solopovas
  • 967
  • 11
  • 41