jQueryExternForHaxe icon indicating copy to clipboard operation
jQueryExternForHaxe copied to clipboard

Use JQuery from npm module

Open zabojad opened this issue 8 years ago • 4 comments

Hi !

How can we use it when Jquery is installed from npm and required from webpack ?

Is there a way / option for the JQuery class to be metadata-ed jsRequire('jquery')?

Best,

Thomas

zabojad avatar Oct 26 '17 14:10 zabojad

Ah... I see this.

But setting -D hxnodejs will not have any side effect? Is it a jQueryExternForHaxe option or is it used elsewhere?

zabojad avatar Oct 26 '17 14:10 zabojad

It doesn't seem to work:

Uncaught ReferenceError: jQuery is not defined

I use both -D hxnodejs and --macro "js.jquery.Config.setNative('jQuery')". Is that allowed?

zabojad avatar Oct 26 '17 14:10 zabojad

@andyli I workaround this issue by applying this suggestion:

untyped __js__("global.jQuery = require('jquery')");

Should we address this case in jQueryExternForHaxe or is this a Webpack issue?

zabojad avatar Oct 26 '17 15:10 zabojad

I've no experience in using Webpack, so I'm not sure. It would be easier for me to fix it if you can provide a minimal example of the issue.

andyli avatar Oct 27 '17 04:10 andyli