We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
resources
1 parent 6d4a114 commit 8fbddcfCopy full SHA for 8fbddcf
Package.swift
@@ -52,3 +52,17 @@ let package = Package(
52
),
53
]
54
)
55
+
56
+// `resources` implicitly forces the package to link `Foundation` but
57
+// we don't actually need it at runtime since the `resources` declaration
58
+// is just for teaching carton how to bundle .js files into the package.
59
+// For those who really want to avoid linking `Foundation` at all, you can
60
+// set the `JAVASCRIPTKIT_NO_FOUNDATION` environment variable to any value
61
+// before running `swift test` or `swift build` to skip the `resources` declaration.
62
+import Foundation
63
64
+if ProcessInfo.processInfo.environment["JAVASCRIPTKIT_NO_FOUNDATION"] != nil {
65
+ for target in package.targets {
66
+ target.resources = nil
67
+ }
68
+}
0 commit comments