Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,17 @@ let package = Package(
),
]
)

// `resources` implicitly forces the package to link `Foundation` but
// we don't actually need it at runtime since the `resources` declaration
// is just for teaching carton how to bundle .js files into the package.
// For those who really want to avoid linking `Foundation` at all, you can
// set the `JAVASCRIPTKIT_NO_FOUNDATION` environment variable to any value
// before running `swift test` or `swift build` to skip the `resources` declaration.
import Foundation

if ProcessInfo.processInfo.environment["JAVASCRIPTKIT_NO_FOUNDATION"] != nil {
for target in package.targets {
target.resources = nil
}
}
Loading