sbt-js

Collection of sbt plugins for uniform configuration of Shuwari Africa Ltd. sbt projects, as well as CI and Release related functionality.

NB: Unless specified otherwise, all plugins listed below are sbt AutoPlugins, and will be enabled automatically upon meeting the required plugin dependencies for each.

The following plugins are available:


sbt-vite

addSbtPlugin("africa.shuwari.sbt" % "sbt-vite" % "0.14.2")
Depends On:
sbt-js

Preconfigures projects with opinionated project defaults for ScalaJS libraries and/or applications. Uses Vite for bundling, and postprocessing.

Introduces additional sbt SettingKeys and TaskKeys, specifically:

Key Description Default
vite Task: Compiles, links, and prepares project for packaging and/or processing with external tools." N/A
viteBuild Task: Executes vite build using the options specified in sbt-vite plugin settings. N/A
viteStop Task: Shuts down any running instances of Vite's development server. N/A
vite.base Setting: Option corresponding to Vite's --base setting. See Vite documentation. None
vite.config Setting: Option corresponding to Vite's --config setting. See Vite documentation. None
vite.force Setting: Option corresponding to Vite's --force setting. See Vite documentation. None
vite.logLevel Setting: Option corresponding to Vite's --logLevel setting. See Vite documentation. Level.Info
vite.mode Setting: Option corresponding to Vite's --mode setting. See Vite documentation. if (JSBundlerPlugin.autoImport.jsFullLink.value) ViteImport.Mode.Production else ViteImport.Mode.Development
vite.host Setting: Option corresponding to Vite's --host setting. See Vite documentation. None
vite.port Setting: Option corresponding to Vite's --port setting. See Vite documentation. None
vite.strictPort Setting: Option corresponding to Vite's --strictPort setting. See Vite documentation. None
vite.cors Setting: Option corresponding to Vite's --cors setting. See Vite documentation. None
vite.assetsDir Setting: Option corresponding to Vite's --assetsDir setting. See Vite documentation. None
vite.assetsInlineLimit Setting: Option corresponding to Vite's --assetsInlineLimit setting. See Vite documentation. None
vite.ssr Setting: Option corresponding to Vite's --ssr setting. See Vite documentation. None
vite.sourcemap Setting: Option corresponding to Vite's --sourcemap setting. See Vite documentation. None
vite.minify Setting: Option corresponding to Vite's --minify setting. See Vite documentation. None

sbt-js-core

addSbtPlugin("africa.shuwari.sbt" % "sbt-js" % "0.14.2")

Preconfigures projects with opinionated project defaults for ScalaJS libraries and/or applications. Provides a foundation for incremental assembly using external Javascript ecosystem tools.

Introduces additional sbt SettingKeys and TaskKeys, specifically relevant:

Key Description Default
jsPrepare Task: Compiles, links, and prepares project for packaging and/or processing with external tools." N/A
jsFullLink Setting: Defines whether "fullLink" or "fastLink" ScalaJS Linker output is used. true where NODE_ENV environment variable is defined with a value of peoduction. and false otherwise.
js Task: Process and/or package assembled project with external tools. Unimplemented. To be customised by end-user.
jsSource Setting: Default directory containing sources and resources to be copied as-is to jsPrepare / target during jsPrepare execution. (Compile / sourceDirectory) / js
js / sourceDirectories Setting: List of all directories containing sources and resources to be copied as-is to jsPrepare / target during jsPrepare execution. (Compile / sourceDirectory) / js
js / target Setting: Defines a target directory for the js task. Usable if required. N/A
jsPrepare / target Setting: Defines a default target directory for the jsPrepare task. N/A
jsPrepare / fileInputIncludeFilter Setting: An sbt sbt.nio.file.PathFilter inclusion filter to apply to the input sources and resources copied to the prepared assembly by jsPrepare. RecursiveGlob
jsPrepare / fileInputExcludeFilter Setting: An sbt sbt.nio.file.PathFilter exclusion filter to apply to the input sources and resources copied to the prepared assembly by jsPrepare. HiddenFileFilter

License

Copyright © Shuwari Africa Ltd. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.