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

Issue with vshaxe / compilation server? #116

Open
mockey opened this issue Mar 23, 2023 · 4 comments
Open

Issue with vshaxe / compilation server? #116

mockey opened this issue Mar 23, 2023 · 4 comments

Comments

@mockey
Copy link

mockey commented Mar 23, 2023

I tried modular for a very simple code splitting setup. Pure haxe and I just want one class splitted into a separate file. Worked nicely withBundle.load.
But when I compile again from vshaxe (default task) the code is not splitted anymore. I get one complete file then. When I try haxe build.hxml from the command line it works. So I thought it might have to do with the compilation server or cache. Adding "haxe.enableCompilationServer": false to a settings.json makes code splitting work every time. Is this a known issue?
Also -D js-es=6 seems to mandatory for loading files. Is this correct?

@elsassph
Copy link
Owner

elsassph commented Apr 1, 2023

Would you have a sample project or just paste the task definition?
Splitting is done post-build with a NodeJS script which may fail to run in this case - it can also be disabled with -D modular_stub.

-D js-es=6 shouldn't be required

@mockey
Copy link
Author

mockey commented Apr 3, 2023

Well, as I wrote: splitting generally works well, I see the output:

AST processed in: 28ms
Bundling...
Graph processed in: 2ms
Emit ..../script-1.js
Emit ..../script-2.js
Write ..../script-1.js
Write ..../script-2.js

But when I compile a second time without changing anything and using default build task from vshaxe, I only get:

Emit ..../script-1.js
Write ..../script-1.js

So no more splitting. If I change something in the code splitting works again.

I think by default vshaxe uses the compilation server for building that is also used for code completion and caching. If I switch that off with "haxe.enableCompilationServer": false, splitting works reliably every time. So no big deal actually, I was just wondering if this might be a known issue. I could try that with a sample project maybe.

You're right about -D js-es=6, though. Don't know what I saw there.

Thanks for making this tool available. Are you still using it yourself as well?

@elsassph
Copy link
Owner

elsassph commented Apr 5, 2023

So second time does the JS output look complete? e.g. just not split?

Unfortunately I don't use it much myself anymore... Job doesn't include any Haxe now.

@mockey
Copy link
Author

mockey commented Apr 13, 2023

Yes, exactly.
First build: two split files.
Second build (without changing anything): one complete (and working) js file.

With "haxe.enableCompilationServer": false (in .vscode/settings.json) always two split files (compilation takes a little longer, though).

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

2 participants