Configuration options for custom workflows; scalaJsResolverPlugin#34
Open
raquo wants to merge 4 commits into
Open
Configuration options for custom workflows; scalaJsResolverPlugin#34raquo wants to merge 4 commits into
raquo wants to merge 4 commits into
Conversation
Adds resiliency when `vite build`-ing multiple projects at once.
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.
I've been looking into using Scala.js in Electron, and needed additional functionality from the vite plugin to support Electron's development workflow... or maybe just my flavor of it. Unlike typical frontend development, there's a node.js component that needs to be integrated with
fastLinkJS + vite buildrather than the vite dev server; the proposed features stem from me trying to wrangle a custom workflow that would work nicely. I think the end result could be broadly useful for custom workflow in general.I believe everything in this PR is backwards compatible, there should be no breaking changes to users.
New features:
taskplugin option where you can specifyfastLinkJSOutputorfullLinkJSOutput(or a custom command) to decouple this fromNODE_ENV(default remains the same).concurrently 'vite build this' 'vite build that'. This can be avoided by sleeping, but it's nicer when it just works.maxAttemptsoption. If you're ok to change behaviour, we could set the defaultmaxAttemptsto 3.scalaJsResolverPluginthat is exported separately. All it does is resolve thescalajs:prefix to the scala.js output path that the user needs to provide.vite buildfrom within sbt already. Or I guess from another build tool.Technical changes
scalaJSPlugintoscalaJsSbtPlugin:sbtto differentiate from the other pluginJStoJsbecause it's hard to have good camel case names with uppercase acronyms (scalaJSSbtPlugin,scalaJSSBTPluginare all less readable). I tend to treat acronyms as if they were words when camelCase-ing, makes naming (and reading) easier.scalaJsSbtPluginandscalaJsResolverPluginthen the new naming becomes relevant and is self-consistent.JSin the type names of the *Options interfaces to avoid any potential breakage in the public API. Would be nice to convert those toJsfor consistency later.{ shell: true, ...options }to make it consistent with other code. Don't have a preference either way, just wanted to give IDEA a chance to format the file without causing edits.Hopefully the above decisions are acceptable, these individual features were too small to make PRs individually, so I yolo-d on bundling them. But if something here is not agreeable, let me know of course.