{"id":40952,"library":"esbuild-scalajs","title":"esbuild-scalajs","description":"An esbuild plugin for Scala.js that integrates the Scala.js build output (JavaScript files) into esbuild bundling. This plugin allows using esbuild to bundle Scala.js projects, replacing or supplementing the default Scala.js linker. Version 0.0.5 is experimental and pre-1.0; releases are sparse. It currently requires an existing Scala.js build (sbt fastOptJS/fullOptJS) and only bundles the resulting JavaScript. Unlike full build tools, it does not compile Scala code directly. The plugin is designed for developers already using Scala.js who want to leverage esbuild's fast bundling, code splitting, and plugin ecosystem. It is not actively maintained.","status":"active","version":"0.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/windymelt/esbuild-plugin-scalajs","tags":["javascript","esbuild","scala"],"install":[{"cmd":"npm install esbuild-scalajs","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-scalajs","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-scalajs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is an esbuild plugin that hooks into esbuild's build process.","package":"esbuild","optional":false}],"imports":[{"note":"The package exports a default function; using require may work but is not the intended ESM usage.","wrong":"const scalaJsPlugin = require('esbuild-scalajs')","symbol":"default","correct":"import scalaJsPlugin from 'esbuild-scalajs'"},{"note":"The package also exports a named export 'scalaJsPlugin' which is the same as default. Default import is preferred.","wrong":"import scalaJsPlugin from 'esbuild-scalajs'","symbol":"scalaJsPlugin","correct":"import { scalaJsPlugin } from 'esbuild-scalajs'"},{"note":"TypeScript users can import the options type for configuration. No CommonJS equivalent for types.","wrong":null,"symbol":"ScalaJsPluginOptions","correct":"import type { ScalaJsPluginOptions } from 'esbuild-scalajs'"}],"quickstart":{"code":"import scalaJsPlugin from 'esbuild-scalajs';\nimport * as esbuild from 'esbuild';\n\nawait esbuild.build({\n  entryPoints: ['target/scala-2.13/example-fastopt/main.js'],\n  bundle: true,\n  outdir: 'dist',\n  plugins: [scalaJsPlugin()],\n});","lang":"typescript","description":"Basic usage: bundling a Scala.js output file with esbuild using the plugin. Assumes Scala.js has already been compiled."},"warnings":[{"fix":"Use a single entry point or manually concatenate multiple Scala.js outputs before bundling.","message":"Plugin may not handle multiple entry points correctly; only single entry point tested.","severity":"breaking","affected_versions":"=0.0.5"},{"fix":"Ensure Scala.js artifacts exist before running esbuild. Use sbt to compile first.","message":"Requires Scala.js to be compiled separately (sbt fastOptJS/fullOptJS) before running esbuild. Not a drop-in replacement for the Scala.js linker.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin to exact version and monitor repository for updates.","message":"Version 0.0.5 is pre-1.0; API may change in future releases.","severity":"deprecated","affected_versions":"<1.0.0"}],"env_vars":null,"search_vec":"'-1.0':42 '0.0.5':37 'activ':97 'allow':22 'alreadi':78 'build':13,52,63 'bundl':19,26,57,88 'code':70,89 'compil':68 'current':47 'default':33 'design':75 'develop':77 'direct':71 'ecosystem':93 'esbuild':2,5,18,24,85,100 'esbuild-scalaj':1 'exist':50 'experiment':39 'fast':87 'fastoptjs/fulloptjs':54 'file':16 'full':62 'integr':10 'javascript':15,60,99 'leverag':84 'linker':35 'maintain':98 'output':14 'plugin':6,21,73,92 'pre':41 'project':28 'releas':43 'replac':29 'requir':48 'result':59 'sbt':53 'scala':69,101 'scala.js':8,12,27,34,51,80 'scalaj':3 'spars':45 'split':90 'supplement':31 'tool':64 'unlik':61 'use':23,79 'version':36 'want':82","created_at":"2026-06-04T18:50:03.556069+00:00","updated_at":"2026-06-04T18:50:03.556069+00:00","problems":[{"fix":"Use scalaJsPlugin() with empty parentheses to invoke and return the plugin object.","cause":"Calling the default export without parentheses returns the function itself, not the plugin object.","error":"Error: The plugin \"scalaJsPlugin\" returned a function (expected a plugin object) when called without options"},{"fix":"Run sbt fastOptJS or fullOptJS before esbuild to generate the Scala.js output.","cause":"Scala.js has not been compiled yet, so the entry point file does not exist.","error":"Error: [plugin: scalaJsPlugin] No such file or directory: 'target/scala-2.13/example-fastopt/main.js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/windymelt/esbuild-plugin-scalajs#readme","github":"https://github.com/windymelt/esbuild-plugin-scalajs","docs":null,"changelog":null,"pypi":null,"npm":"esbuild-scalajs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}