kevinresol / hxgenjs

Extensible JS generator for Haxe
57 stars 16 forks source link

Binding 'eval' in strict mode (108:20) #31

Closed sonygod closed 5 years ago

sonygod commented 5 years ago

hi,just test with heaps framework ,and got this error.

haxe -lib heaps -lib hxgenjs -cp src -cp samples -js Y:/test/test/src/components/haxe/haxetest.js -main Main -dce no -D hxextern

haxe version:3.4.7

shareshader.js run in vue

image

elsassph commented 5 years ago

Visibly Heaps uses eval as function argument name somewhere. It looks like the webpack bundling (looks like Babel processing involved to process Vue files) doesn't allow using this name in the code.

You may have to either look whether non complaining about eval is an option for Babel, or suggest Heaps to not use this argument name.

sonygod commented 5 years ago

@elsassph current hxgenjs is not work for Chrome ,May be it's only for Node.js dev.

it's export by custom define exports ,not work

@kevinresol

kevinresol commented 5 years ago

Did you bundle on chrome?

sonygod commented 5 years ago

build haxe code for vue dev,run in chrome browser.

kevinresol commented 5 years ago

hxgenjs emits CommonJS code (sync require) and that won't work on browser by default. You need to bundle it using webpack or browsify, etc. Did you do so? And what is the exact error you are getting?

sonygod commented 5 years ago

yes ,I use Vue-cli 3.4 tool to build and wepack the sources from hxgenjs.

after webpack,it's throw exports is not defined.

I can give you small project example later.

build args

... main Main -dce full -D hxextern

here is examples files and error

kevinresol commented 5 years ago

did you try patching the eval argument name to something else?

sonygod commented 5 years ago

I don't have use eval anywhere

,it's seem include Heaps engine ,for shader .

kevinresol commented 5 years ago

Doesn't seem to be a problem of hxgenjs. Closing for now.