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

Optional nodejs build? #48

Closed
jimafisk opened this issue Jul 30, 2020 · 1 comment
Closed

Optional nodejs build? #48

jimafisk opened this issue Jul 30, 2020 · 1 comment

Comments

@jimafisk
Copy link
Member

We're finally at a working solution for removing NodeJS as a dependency of the project (#40) 🎸 🤘

That brings up the question of what to do with the old NodeJS dependent build process. My initial thought was to completely remove this, which is what I've already done for the client build. Now I'm thinking there is some advantages to adding it back in 🤦 (and leaving the static html nodejs build as an option as well).

So leaving a NodeJS option would have the following pros / cons:

Pros Cons
Can test broken things against native NodeJS builds More code, harder to maintain, changes to things like props have to be made in two places
Allows devs to continue ejecting the core build process for modification Slightly slower builds since prep for both builds will be run every time because I'm planning on only breaking out the exec.Command()
Could be faster in some scenarios (with defaults it's slower though) More work to set up the flags for build and serve commands, as well as make these optional when nodejs is run

References:

If keeping this in as an option for now, we should add a flag to that would look like this when applied in the CLI:

  • plenti build --nodejs=true
  • plenti serve --nodejs=true

Alternatively you should be able to set this in the site-wide configuration file (plenti.json). We'd have to modify the API to allow something like:

{
  "build": {
    "output": "public",
    "nodejs": true
  }
}
@jimafisk
Copy link
Member Author

jimafisk commented Aug 3, 2020

This is now incorporated into the 0.2.* versions of plenti: da0ab90

The CLI flag (--nodejs=true) should work with both the build and serve commands.

I did not update the plenti.json config file API to allow declaring nodejs builds there (as proposed above). If this becomes useful to folks down the road, happy to add it.

@jimafisk jimafisk closed this as completed Aug 3, 2020
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

1 participant