Open
Conversation
…kage.json and node_modules out-last multiple builds. Optional preupdate, update, prebuild, build scripts. Required run and test scripts (which replace default lime run and lime build+run behavior)
…uild and other assets/templates to /public
Member
Author
|
After writing and considering the path of this pull request, I've made a course change and moved back to the following:
I could have done this using http-server, and it would have appeared even more seamless, however I suspect it would also lead to a dead-end, of "why is this even here?" Instead, I've made a minimal configuration which uses vite to build and serve. Vite is doing very little here, though it offers a suggestion of what could be possible. Uncertain if Haxe NPM should be used for hot code reloading, as it breaks expectations on how Haxe sources are built (different Haxe version, features, so on) |
…al builds into bin (NPM minification would require a second/seperate build)
Member
Author
|
If we like some or all of this, I can also break into smaller pull requests. I can also adjust based on feedback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In practice, a developer would use the new workflow like this:
<template path="templates" />and<config:html5 npm="true" />to their project.xmlThe PR makes the following changes:
lime display (target) --template-contextcommandlime display (target) --template-context --jsoncommand-npm(as before) or<config:html5 npm="true"/>(new)lime cleantargetDirectoryinstead oftargetDirectory + "/bin"targetDirectory + "/build"targetDirectory + "/public"LIB_(NAME)_PATHtemplate context variable, in addition toLIB_(NAME)lime test html5 -finalcalls "lime:build" + "lime:run" scripts (production), rather than "lime:test" (dev server)Example project:
https://github.com/openfl/flight
The above project does not automatically recompile Haxe sources (although it should hot reload if the Haxe sources do change), however this could still be done with a little cleverness. The "hxml" folder is still present within the NPM project context, so installing Haxe as an NPM dependency, or using a plugin, should make it possible.
I avoided making that required by default, because it breaks promises the Lime build process makes in terms of your Haxe code output, like what version of Haxe is used. The default NPM package.json in this pull request is designed to form the basis of customization by the user, rather than presuming which packages and path they would like to take, which may be the most mature path to take here.
Open to feedback