SwiftyESBuild

0.3.0

⭐️ A Swift Package to integrate ESBuild into Swift projects
tuist/SwiftyESBuild

What's New

0.3.0

2023-11-11T12:12:05Z

What's changed

  • We fixed a compatibility issue with the aarch64 architecture.

Full Changelog: 0.2.0...0.3.0

SwiftyESBuild ⭐️

Netlify Status SwiftyESBuild

SwiftyESBuild is a Swift Package that wraps ESBuild to ease bringing bundling capabilities to Swift on Server apps.

Usage

First, you need to add SwiftyESBuild as a dependency in your project's Package.swift:

.package(url: "https://github.com/tuist/SwiftyESBuild.git", .upToNextMinor(from: "0.2.0"))

Once added, you'll create an instance of SwiftyESBuild specifying the version you'd like to use and where you'd like it to be downloaded.

let esbuild = SwiftyESBuild(version: .latest, directory: "./cache")

If you don't pass any argument, it defaults to the latest version in the system's default temporary directory. If you work in a team, we recommend fixing the version to minimize non-determinism across environments.

Running ESBuild

To run ESBuild you need to invoke the run function:

import TSCBasic // AbsolutePath

let entryPointPath = AbsolutePath(validating: "/project/index.js")
let outputBundlePath = AbsolutePath(validating: "/projects/build/index.js")
try await esbuild.run(entryPoint: entryPointPath, options: .bundle, .outfile(outputBundlePath))

Description

  • Swift Tools 5.8.0
View More Packages from this Author

Dependencies

Last updated: Mon Dec 09 2024 19:30:06 GMT-1000 (Hawaii-Aleutian Standard Time)