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

Overhaul of file deployment in dev mode and production mode #81

Merged
merged 17 commits into from
Jul 15, 2024
Merged

Overhaul of file deployment in dev mode and production mode #81

merged 17 commits into from
Jul 15, 2024

Conversation

tsevasa
Copy link
Contributor

@tsevasa tsevasa commented Jul 14, 2024

Please test this with DEV_BUILD turned on and off, respectively. It works perfectly fine for me.

@tsevasa
Copy link
Contributor Author

tsevasa commented Jul 14, 2024

ToDos:

  • Currently, the copy method copies over many unnecessary game scripts to dist that are never loaded into an HTML. Although it doesn't matter, we should only copy what is necessary.
  • Revert bundling for development mode.

@Naviary2
Copy link
Member

Naviary2 commented Jul 14, 2024

Looking great! It's very fast for me too! 👏 (and it works in both dev and production for me)

Screen Shot 2024-07-14 at 12 00 42 AM

I fixed this error! The validation script is not directly part of the game code.

Basically what's left is (and I'm sort of re-iterating what you already put) is to

  • In production, skip copying over the game code to dist (except for concatenating app.js).
  • In dev, skip concatenating app.js. (We can create a new module "HTMLPreparator" that will inject the script tags we need into play.html's header, depending on if we're in dev or production.

@Naviary2 Naviary2 added the modification needed A change needs to be made label Jul 14, 2024
@tsevasa
Copy link
Contributor Author

tsevasa commented Jul 15, 2024

The TODO list is finished! In dev mode, now all assets and scripts are just copied over to dist. In prod mode, the scripts are concatenated into app.js (where applicable), and minified.

Finally, the play.html page, now does not call any game scripts by itself anymore. Instead, HTMLScriptInjector.js automatically recognizes the contents of dist/scripts/game and adds the appropriate script calls to the HTML file.

@tsevasa tsevasa changed the title Automatic bundling (+ minification in production mode) Overhaul of file deployment in dev mode and production mode Jul 15, 2024
@Naviary2 Naviary2 merged commit f6df163 into Infinite-Chess:main Jul 15, 2024
1 check passed
@Naviary2 Naviary2 removed the modification needed A change needs to be made label Jul 16, 2024
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

Successfully merging this pull request may close these issues.

2 participants