Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you give a example project use in vue? #56

Open
sonygod opened this issue Mar 3, 2019 · 9 comments
Open

can you give a example project use in vue? #56

sonygod opened this issue Mar 3, 2019 · 9 comments

Comments

@sonygod
Copy link

sonygod commented Mar 3, 2019

can you give a example project use webpack-haxe-loader in vue?

@elsassph
Copy link
Collaborator

elsassph commented Mar 3, 2019

Good idea.

Did you try VueHx (https://github.com/DenkiYagi/vuehx) without Webpack first? It doesn't need Webpack at all.

Or do you want to use the official Vue plugin because you'd like to include some Haxe code in a wider Vue project?

@sonygod
Copy link
Author

sonygod commented Mar 3, 2019

I need to use in real vue dev with Vue CLI 3.4.1

I 'd like to include some haxe code inside Vue project,

@elsassph

by the way ,I also want to try [hxgenjs](https://github.com/kevinresol/hxgenjs) with Vue,

@elsassph
Copy link
Collaborator

elsassph commented Mar 3, 2019

You can use either Webpack Haxe Loader or hxgenjs, but not together.

Also do you want to interop JS-side Vue components and Haxe side Vue components? Or just include some special content using Haxe (considering your Heaps-related question)?

@sonygod
Copy link
Author

sonygod commented Mar 3, 2019

I try to use Heaps engine in Vue-cli, but it's too big to build every time ,so I want to choose hxgenjs to

reduce js size suit for hot reload.but it's not work

and I want to use your webpack-haxe-loader for debug only in hx files.

@elsassph
Copy link
Collaborator

elsassph commented Mar 3, 2019

Are you trying to use Heaps as renderer for Vue? Or just render a non-Vue piece using Heaps?

In the second case, if you don't want to build it often it's indeed a good idea to just build it separately, and even load it lazily.

@vrescobar
Copy link

vrescobar commented Jul 8, 2019

Hi @sonygod I had the same problem and I ended up forking the repo in order to create the simplest webpack loader for haxe. I use personally use for Vue as well so it includes an example of config for it.

https://github.com/vrescobar/webpack-haxe-loader

Since it contains just the minimum amount of features, now it might be trivial to modify the loader to support other variants which deviates from haxe's original behave.

@elsassph
Copy link
Collaborator

elsassph commented Jul 8, 2019

@vrescobar the changes you have done seem rather significant so you should consider renaming your fork to avoid confusion if it's not meant to be compatible, or work with us to fix your issues while keeping the expected functionality.

@vrescobar
Copy link

thanks for the suggestion, I ended up renaming to:
https://github.com/vrescobar/webpack-simple-haxe-loader

Actually, I wanted to ask you, why so much work modifying the args and splitting the code? Supposedly haxe will just remove unused code with DCE.

@elsassph
Copy link
Collaborator

elsassph commented Jul 8, 2019

I agree splitting is a relatively complex feature and it should be possible to completely skip it for small bits of Haxe, but it's not about unused code, it's about reducing the initial JS payload. https://webpack.js.org/guides/code-splitting/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants